{"record":{"id":"368208b073e7c979","repo":"pola-rs/polars","slug":"failed-to-load-catalog-for-fn-name-error-configure-the","errorCode":null,"errorMessage":"failed to load catalog for {fn_name}() ({error = }). Configure the default PyIceberg catalog, or pass a catalog via the 'catalog' parameter, or pass a PyIceberg table object instead of the name.{static_metadata_hint}","messagePattern":"failed to load catalog for (.+?)\\(\\) \\((.+?)\\)\\. Configure the default PyIceberg catalog, or pass a catalog via the 'catalog' parameter, or pass a PyIceberg table object instead of the name\\.(.+?)","errorType":"exception","errorClass":"ComputeError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/io/iceberg/_dataset.py","lineNumber":192,"sourceCode":"            except Exception as error:\n                static_metadata_hint = (\n                    (\n                        \" \"\n                        \"If you intended to pass a static metadata path, \"\n                        \"ensure it is an absolute path.\"\n                    )\n                    if fn_name == \"scan_iceberg\"\n                    else \"\"\n                )\n\n                msg = (\n                    f\"failed to load catalog for {fn_name}() ({error = }). \"\n                    \"Configure the default PyIceberg catalog, or pass \"\n                    \"a catalog via the 'catalog' parameter, or pass a PyIceberg \"\n                    \"table object instead of the name.\"\n                    f\"{static_metadata_hint}\"\n                )\n                raise ComputeError(msg) from error\n\n            catalog_config = IcebergCatalogConfig.from_catalog(default_catalog)\n\n        if catalog_config.class_ == NoopCatalog:\n            msg = f\"cannot use NoopCatalog with {fn_name}()\"\n            raise TypeError(msg)\n\n        return catalog_config\n\n\n@dataclass(kw_only=True)\nclass IcebergScanResolver:\n    \"\"\"\n    Iceberg scan resolver.\n\n    Defers scan resolution to run during IR resolution.\n    \"\"\"\n","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/io/iceberg/_dataset.py#L174-L210","documentation":"When no catalog parameter is supplied, polars calls pyiceberg.catalog.load_catalog() to resolve the default catalog; if that fails (bad/missing pyiceberg config, network/auth errors), it wraps the error in a ComputeError telling the user how to configure or pass a catalog.","triggerScenarios":"Calling pl.scan_iceberg/read_iceberg with catalog=None while the default pyiceberg catalog is unconfigured (no ~/.pyiceberg.yaml / env vars) or fails to initialize (bad credentials, unreachable catalog endpoint).","commonSituations":"Missing pyiceberg.yaml, wrong PYICEBERG_CATALOG env var, expired cloud credentials, or unreachable REST/Hive/Glue catalog endpoint.","solutions":["Configure the default pyiceberg catalog (e.g. via PYICEBERG_CATALOG env var or ~/.pyiceberg.yaml) and retry","Pass an explicit catalog: pyiceberg.catalog.load_catalog(name, **props) via the catalog parameter","Pass a pyiceberg Table object directly instead of a table name to skip catalog loading"],"exampleFix":"// before\npl.scan_iceberg('db.tbl')  # no catalog configured\n// after\nimport pyiceberg.catalog\ncat = pyiceberg.catalog.load_catalog('default', uri='https://rest-catalog/...')\npl.scan_iceberg('db.tbl', catalog=cat)","handlingStrategy":"try-catch","validationCode":"import pyiceberg.catalog\ntry:\n    cat = pyiceberg.catalog.load_catalog()\nexcept Exception as e:\n    raise RuntimeError('Configure default pyiceberg catalog or pass catalog=...') from e","typeGuard":null,"tryCatchPattern":"try:\n    lf = pl.scan_iceberg('db.tbl')\nexcept pl.exceptions.ComputeError as e:\n    if 'failed to load catalog' in str(e):\n        cat = pyiceberg.catalog.load_catalog('default', **props)\n        lf = pl.scan_iceberg('db.tbl', catalog=cat)","preventionTips":["Set up ~/.pyiceberg.yaml or PYICEBERG_CATALOG before calling scan_iceberg/read_iceberg","Pass an explicitly loaded Catalog via the catalog parameter in production code","Verify catalog connectivity/credentials in a preflight check"],"tags":["python","polars","iceberg","catalog","configuration"],"backgroundTag":"missing-config-value","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"}