(df, column_name, path, dtype)
| 315 | |
| 316 | |
| 317 | def add_path_column(df, column_name, path, dtype): |
| 318 | if column_name in df.columns: |
| 319 | raise ValueError( |
| 320 | f"Files already contain the column name: '{column_name}', so the path " |
| 321 | "column cannot use this name. Please set `include_path_column` to a " |
| 322 | "unique name." |
| 323 | ) |
| 324 | return df.assign(**{column_name: pd.Series([path] * len(df), dtype=dtype)}) |
no test coverage detected