{"record":{"id":"d3c6eb122d2e0168","repo":"pola-rs/polars","slug":"write-table-table-format-of-catalog-name-names","errorCode":null,"errorMessage":"write_table: table format of {catalog_name}.{namespace}.{table_name} ({data_source_format}) is unsupported.","messagePattern":"write_table: table format of (.+?)\\.(.+?)\\.(.+?) \\((.+?)\\) is unsupported\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/catalog/unity/client.py","lineNumber":400,"sourceCode":"        )\n\n        if data_source_format in [\"DELTA\", \"DELTASHARING\"]:\n            return df.write_delta(  # type: ignore[misc]\n                storage_location,\n                storage_options=storage_options,\n                credential_provider=credential_provider,\n                mode=delta_mode,\n                delta_write_options=delta_write_options,\n                delta_merge_options=delta_merge_options,\n            )  # type: ignore[call-overload]\n\n        else:\n            msg = (\n                \"write_table: table format of \"\n                f\"{catalog_name}.{namespace}.{table_name} \"\n                f\"({data_source_format}) is unsupported.\"\n            )\n            raise NotImplementedError(msg)\n\n    def create_catalog(\n        self,\n        catalog_name: str,\n        *,\n        comment: str | None = None,\n        storage_root: str | None = None,\n    ) -> CatalogInfo:\n        \"\"\"\n        Create a catalog.\n\n        .. warning::\n            This functionality is considered **unstable**. It may be changed\n            at any point without it being considered a breaking change.\n\n        Parameters\n        ----------\n        catalog_name","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/py-polars/src/polars/catalog/unity/client.py#L382-L418","documentation":"NotImplementedError from Catalog.write_table (py-polars/src/polars/catalog/unity/client.py:390-402). Writing through the Unity Catalog integration supports only the DELTA format (handled by the earlier branch that calls into the delta writer with mode/delta_write_options/delta_merge_options). Any other data_source_format (CSV, JSON, PARQUET, UNITY_*) falls into the else branch and is explicitly unsupported at write time, with the fully qualified table name and format in the message.","triggerScenarios":"catalog.write_table(lf, 'cat.ns.tbl', ...) where the pre-existing table's data_source_format is PARQUET, CSV, or JSON instead of DELTA.","commonSituations":"Writing to tables auto-created by external tools (Databricks SQL CTAS defaults to Delta, but external/foreign tables often are not); targeting tables created by other engines; assuming format conversion is automatic.","solutions":["Write to (or create) a DELTA-format table: CREATE TABLE ... USING DELTA, then call write_table","For non-Delta targets, write directly with polars IO to the storage location (e.g. scan/write parquet with storage_options) instead of the catalog write API","Check the format first: catalog.get_table('cat.ns.tbl').data_source_format == 'DELTA' before write_table"],"exampleFix":"# before\ncatalog.write_table(lf, 'cat.ns.parquet_tbl')  # NotImplementedError\n\n# after\n# ensure the target exists as Delta\n# spark.sql('CREATE TABLE cat.ns.tbl USING DELTA AS SELECT ...')\ncatalog.write_table(lf, 'cat.ns.tbl')","handlingStrategy":"validation","validationCode":"def writable_via_catalog(table_info) -> bool:\n    return str(table_info.data_source_format).endswith('DELTA')","typeGuard":null,"tryCatchPattern":"try:\n    catalog.write_table(lf, f'{cat}.{ns}.{tbl}')\nexcept NotImplementedError:\n    catalog.write_table(lf, f'{cat}.{ns}.{tbl}_delta')  # Delta target instead","preventionTips":["Verify table format is DELTA before write_table; create targets with USING DELTA","For non-Delta targets write directly with polars IO plus storage_options","Fail fast in pipelines by checking format up front rather than at write time"],"tags":["polars","unity-catalog","write","delta","notimplementederror"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}