{"record":{"id":"a36e30970fc2112b","repo":"pola-rs/polars","slug":"include-file-paths-cannot-be-used-with-use-pyar","errorCode":null,"errorMessage":"`include_file_paths` cannot be used with `use_pyarrow=True`","messagePattern":"`include_file_paths` cannot be used with `use_pyarrow=True`","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/io/parquet/functions.py","lineNumber":248,"sourceCode":"    del row_index_name\n    del row_index_offset\n\n    if schema is not None:\n        msg = \"the `schema` parameter of `read_parquet` is considered unstable.\"\n        issue_unstable_warning(msg)\n\n    if hive_schema is not None:\n        msg = \"the `hive_schema` parameter of `read_parquet` is considered unstable.\"\n        issue_unstable_warning(msg)\n\n    # Dispatch to pyarrow if requested\n    if use_pyarrow:\n        if n_rows is not None:\n            msg = \"`n_rows` cannot be used with `use_pyarrow=True`\"\n            raise ValueError(msg)\n        if include_file_paths is not None:\n            msg = \"`include_file_paths` cannot be used with `use_pyarrow=True`\"\n            raise ValueError(msg)\n        if schema is not None:\n            msg = \"`schema` cannot be used with `use_pyarrow=True`\"\n            raise ValueError(msg)\n        if hive_schema is not None:\n            msg = (\n                \"cannot use `hive_partitions` with `use_pyarrow=True`\"\n                \"\\n\\nHint: Pass `pyarrow_options` instead with a 'partitioning' entry.\"\n            )\n            raise TypeError(msg)\n\n        df = _read_parquet_with_pyarrow(\n            source,\n            columns=columns,\n            storage_options=storage_options,\n            pyarrow_options=pyarrow_options,\n            memory_map=memory_map,\n        )\n","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/io/parquet/functions.py#L230-L266","documentation":"The include_file_paths option (which adds a column recording the source file per row) is implemented only in Polars' native parquet reader. With use_pyarrow=True the read is dispatched to pyarrow, so this option cannot be provided and is rejected with a ValueError.","triggerScenarios":"pl.read_parquet(..., use_pyarrow=True, include_file_paths='path') — any non-None include_file_paths with use_pyarrow=True.","commonSituations":"Multi-file/hive reads where users want provenance columns while also forcing the pyarrow backend; enabling pyarrow dispatch for speed while keeping native-reader metadata features.","solutions":["Remove include_file_paths when using use_pyarrow=True","Drop use_pyarrow=True so the native reader can add the file-path column","Post-process: read via pyarrow, then add the column manually with pl.lit(filename).alias('path')"],"exampleFix":"// before\npl.read_parquet(['a.parquet','b.parquet'], use_pyarrow=True, include_file_paths='path')\n// after\npl.read_parquet(['a.parquet','b.parquet'], include_file_paths='path')","handlingStrategy":"validation","validationCode":"if use_pyarrow and include_file_paths is not None:\n    raise ValueError('include_file_paths cannot be used with use_pyarrow=True')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember include_file_paths is native-reader only","Add provenance columns manually after a pyarrow read","Keep feature flags (use_pyarrow) and metadata options decoupled in config"],"tags":["polars","parquet","pyarrow"],"backgroundTag":"conflicting-config-options","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}