{"record":{"id":"d9d70e3501806c23","repo":"pola-rs/polars","slug":"cannot-operation-no-data-source-format-found","errorCode":null,"errorMessage":"cannot {operation}: no data_source_format found","messagePattern":"cannot (.+?): no data_source_format found","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/catalog/unity/client.py","lineNumber":751,"sourceCode":"            msg = (\n                \"did not receive credentials from temporary credentials API for \"\n                f\"{table_id = }\"\n            )\n            raise Exception(msg)  # noqa: TRY002\n\n        yield creds, expiry\n\n\ndef _extract_location_and_data_format(\n    table_info: TableInfo, operation: str\n) -> tuple[str, DataSourceFormat]:\n    if table_info.storage_location is None:\n        msg = f\"cannot {operation}: no storage_location found\"\n        raise ValueError(msg)\n\n    if table_info.data_source_format is None:\n        msg = f\"cannot {operation}: no data_source_format found\"\n        raise ValueError(msg)\n\n    return table_info.storage_location, table_info.data_source_format\n","sourceCodeStart":733,"sourceCodeEnd":754,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/catalog/unity/client.py#L733-L754","documentation":"_extract_location_and_data_format raises ValueError when table_info.data_source_format is None: the Unity Catalog table metadata omits the data source format, so the reader/writer cannot determine which file format to use.","triggerScenarios":"scan_table or write_table where TableInfo.data_source_format is None — tables created without a recognized format or metadata returned by a server that omits the field.","commonSituations":"Tables registered in UC without an explicit format; unsupported/unrecognized data source format serialized as null; older catalog server versions.","solutions":["Recreate/alter the table with an explicit data source format (e.g. DELTA)","Inspect table_info.data_source_format before scanning and supply format explicitly if the API allows","Upgrade the unity-catalog server so it populates data_source_format"],"exampleFix":"// before\ninfo = cat.get_table('catalog.schema.tbl')  # data_source_format None\npl.read_delta(info)  # ValueError\n// after\n# in UC: CREATE TABLE ... USING DELTA LOCATION 's3://bucket/tbl'\ninfo = cat.get_table('catalog.schema.tbl')  # format DELTA","handlingStrategy":"validation","validationCode":"info = cat.get_table(name)\nassert info.data_source_format is not None, f'{name} has no data_source_format'","typeGuard":"def has_known_format(info) -> bool:\n    return info.data_source_format is not None","tryCatchPattern":"try:\n    lf = cat.scan_table(name)\nexcept ValueError as e:\n    if 'data_source_format' in str(e):\n        logging.error('unknown format for table %s', name)\n    raise","preventionTips":["Create tables with an explicit USING DELTA (or other) format","Verify format after get_table before scanning","Keep unity-catalog server up to date"],"tags":["unity-catalog","table-metadata","unsupported-format"],"backgroundTag":"missing-required-config-field","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"}