{"record":{"id":"516b35c79101b480","repo":"pola-rs/polars","slug":"cannot-operation-no-storage-location-found","errorCode":null,"errorMessage":"cannot {operation}: no storage_location found","messagePattern":"cannot (.+?): no storage_location found","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/catalog/unity/client.py","lineNumber":747,"sourceCode":"        yield storage_update_options\n\n        if not creds:\n            table_id = self.table_id\n            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":729,"sourceCodeEnd":754,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/catalog/unity/client.py#L729-L754","documentation":"_extract_location_and_data_format validates the Unity Catalog table info before scanning/writing; it raises ValueError when table_info.storage_location is None, i.e. the table metadata has no storage location configured so no path can be derived.","triggerScenarios":"scan_table or write_table on a table whose TableInfo.storage_location is None — typically managed tables (UC manages the location server-side) or tables queried via a name whose metadata omits the field.","commonSituations":"Pointing the catalog at a UC managed table instead of an external/delta table; stale or partially returned TableInfo from the REST API; using an older unity-catalog server that doesn't populate the field.","solutions":["Use an external (storage-backed) table with an explicit storage_location","Fetch fresh table info (catalog.get_table(...)) to confirm storage_location is populated","Check the unity-catalog server version supports returning storage_location","Write the table to an explicit location so storage_location is set"],"exampleFix":"// before\ninfo = cat.get_table('catalog.schema.managed_tbl')  # storage_location None\npl.scan_delta(info)  # ValueError\n// after\ninfo = cat.get_table('catalog.schema.external_tbl')  # has storage_location\npl.scan_delta(info)","handlingStrategy":"validation","validationCode":"info = cat.get_table(name)\nassert info.storage_location is not None, f'{name} has no storage_location'","typeGuard":"def is_scannable(info) -> bool:\n    return info.storage_location is not None and info.data_source_format is not None","tryCatchPattern":"try:\n    lf = cat.scan_table(name)\nexcept ValueError as e:\n    if 'storage_location' in str(e):\n        logging.error('table %s is managed or has no location', name)\n    raise","preventionTips":["Prefer external tables for direct scan/write workflows","Re-fetch table info before use to avoid stale metadata","Check server support for storage_location in TableInfo"],"tags":["unity-catalog","table-metadata"],"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"}