{"record":{"id":"6be7d466ba9fcfab","repo":"pola-rs/polars","slug":"cannot-apply-delta-table-options-for-table-of-type","errorCode":null,"errorMessage":"cannot apply delta_table_options for table of type {data_source_format}","messagePattern":"cannot apply delta_table_options for table of type (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/catalog/unity/client.py","lineNumber":285,"sourceCode":"                version=delta_table_version,\n                delta_table_options=delta_table_options,\n                storage_options=storage_options,\n                credential_provider=credential_provider,\n            )\n\n        if delta_table_version is not None:\n            msg = (\n                \"cannot apply delta_table_version for table of type \"\n                f\"{data_source_format}\"\n            )\n            raise ValueError(msg)\n\n        if delta_table_options is not None:\n            msg = (\n                \"cannot apply delta_table_options for table of type \"\n                f\"{data_source_format}\"\n            )\n            raise ValueError(msg)\n\n        return wrap_ldf(\n            self._client.scan_table(\n                catalog_name,\n                namespace,\n                table_name,\n                credential_provider=credential_provider,\n                cloud_options=storage_options,\n            )\n        )\n\n    def write_table(\n        self,\n        df: DataFrame,\n        catalog_name: str,\n        namespace: str,\n        table_name: str,\n        *,","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/py-polars/src/polars/catalog/unity/client.py#L267-L303","documentation":"ValueError from the Unity Catalog scan path (py-polars/src/polars/catalog/unity/client.py:277-287). delta_table_options (extra options handed to the Delta scan engine, e.g. delta-specific reader configs) is only valid when data_source_format is DELTA; that path returns early via scan_delta. For PARQUET/CSV/JSON/UNITY tables the option dict has no consumer, so passing it raises rather than being silently dropped. Use storage_options for cloud credentials on non-Delta tables.","triggerScenarios":"catalog.read_table('cat.schema.tbl', delta_table_options={'delta.appendOnly': 'true'}) on a non-Delta table; generic option-forwarding wrappers that always populate delta_table_options.","commonSituations":"Copy-pasting a Delta read call onto a Parquet-backed table; conflating storage_options (cloud creds) with delta_table_options (Delta engine hints).","solutions":["Remove delta_table_options for non-Delta tables","Pass cloud credentials via storage_options instead, which is supported for all formats","Gate Delta-specific options on data_source_format == 'DELTA' in wrapper code"],"exampleFix":"# before\nldf = catalog.read_table('cat.ns.tbl', delta_table_options=delta_cfg)  # PARQUET table\n\n# after\nldf = catalog.read_table('cat.ns.tbl', storage_options=storage_cfg)","handlingStrategy":"validation","validationCode":"def split_table_options(fmt: str, delta_opts: dict | None, storage_opts: dict | None):\n    if fmt != 'DELTA' and delta_opts:\n        raise ValueError('delta_table_options only valid for DELTA tables')\n    return delta_opts if fmt == 'DELTA' else None, storage_opts","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep storage_options (cloud creds) and delta_table_options (Delta engine hints) separate","Check data_source_format before forwarding Delta-specific options","Default delta_table_options to None in generic readers"],"tags":["polars","unity-catalog","delta","options","valueerror"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}