{"record":{"id":"0b2594325fc45b74","repo":"pola-rs/polars","slug":"write-parquet-with-use-pyarrow-true-cannot-be-co-0b2594","errorCode":null,"errorMessage":"write_parquet with `use_pyarrow=True` cannot be combined with `mkdir`","messagePattern":"write_parquet with `use_pyarrow=True` cannot be combined with `mkdir`","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/dataframe/frame.py","lineNumber":4315,"sourceCode":"            compression = \"uncompressed\"\n        if isinstance(file, (str, Path)):\n            if partition_by is not None or (\n                pyarrow_options is not None and pyarrow_options.get(\"partition_cols\")\n            ):\n                file = normalize_filepath(file, check_not_directory=False)\n            else:\n                file = normalize_filepath(file)\n\n        if use_pyarrow:\n            if statistics == \"full\" or isinstance(statistics, dict):\n                msg = \"write_parquet with `use_pyarrow=True` allows only boolean values for `statistics`\"\n                raise ValueError(msg)\n            if metadata is not None:\n                msg = \"write_parquet with `use_pyarrow=True` cannot be combined with `metadata`\"\n                raise ValueError(msg)\n            if mkdir:\n                msg = \"write_parquet with `use_pyarrow=True` cannot be combined with `mkdir`\"\n                raise ValueError(msg)\n\n            tbl = self.to_arrow()\n            data = {}\n\n            for i, column in enumerate(tbl):\n                # extract the name before casting\n                name = f\"column_{i}\" if column._name is None else column._name\n\n                data[name] = column\n\n            tbl = pa.table(data)\n\n            # do not remove this import!\n            # needed below\n            import pyarrow.parquet  # noqa: F401\n\n            if pyarrow_options is None:\n                pyarrow_options = {}","sourceCodeStart":4297,"sourceCodeEnd":4333,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/py-polars/src/polars/dataframe/frame.py#L4297-L4333","documentation":"Error \"write_parquet with `use_pyarrow=True` cannot be combined with `mkdir`\" thrown in pola-rs/polars.","triggerScenarios":"Thrown at py-polars/src/polars/dataframe/frame.py:4315 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}