{"record":{"id":"33669d74c5ba5b8c","repo":"pola-rs/polars","slug":"cannot-use-noopcatalog-with-fn-name","errorCode":null,"errorMessage":"cannot use NoopCatalog with {fn_name}()","messagePattern":"cannot use NoopCatalog with (.+?)\\(\\)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/io/iceberg/_dataset.py","lineNumber":198,"sourceCode":"                    )\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\n    table: IcebergTableWrap\n    snapshot_id: int | None\n    from_snapshot_id_exclusive: int | None\n    to_snapshot_id_inclusive: int | None\n    reader_override: Literal[\"native\", \"pyiceberg\"] | None\n    use_metadata_statistics: bool","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/io/iceberg/_dataset.py#L180-L216","documentation":"The Iceberg catalog resolved from the API parameter or environment defaulted to polars' NoopCatalog, which is a placeholder that performs no real catalog operations. polars raises TypeError because scan/sink functions like scan_iceberg or sink_iceberg cannot do anything useful without a functional catalog. This is a fail-fast guard raised from _from_api_parameter_or_environment_default.","triggerScenarios":"Calling an Iceberg API (e.g. scan_iceberg) without passing a catalog parameter while no valid catalog is configured in the environment, so IcebergCatalogConfig.from_catalog(default_catalog) resolves to class_ == NoopCatalog.","commonSituations":"Developers forget to set the catalog URI (e.g. PYICEBERG_CATALOG env var or polars.Config), or run in an environment where pyiceberg falls back to its default 'sql'/noop-style catalog; also happens when the catalog name passed does not match any configured catalog.","solutions":["Pass an explicit catalog argument to the API call (catalog='catalog_name' or a full URI).","Set the catalog configuration in the environment (e.g. PYICEBERG_CATALOG__<name>__URI=...) or pyiceberg config so the default catalog resolves to a real implementation.","Verify the catalog name matches one defined in your ~/.pyiceberg.yaml / .pyiceberg.yaml."],"exampleFix":"// before\npl.scan_iceberg(\"db.table\")  # no catalog configured -> NoopCatalog\n\n// after\npl.scan_iceberg(\"db.table\", catalog=\"my_catalog\")  # or set PYICEBERG_CATALOG env config","handlingStrategy":"validation","validationCode":"catalog = catalog or os.environ.get(\"PYICEBERG_CATALOG\")\nif not catalog or catalog_is_noop(catalog):\n    raise ValueError(\"Configure a real Iceberg catalog before scanning\")","typeGuard":"def is_usable_catalog(cfg: IcebergCatalogConfig) -> bool:\n    return cfg.class_ is not NoopCatalog","tryCatchPattern":"try:\n    df = pl.scan_iceberg(uri, catalog=cat).collect()\nexcept TypeError as e:\n    if \"NoopCatalog\" in str(e):\n        df = pl.scan_iceberg(uri, catalog=\"default\").collect()\n    else:\n        raise","preventionTips":["Always pass an explicit catalog argument to Iceberg APIs in production code.","Set PYICEBERG_CATALOG env vars in deployment config, not just locally.","Add a startup check that the catalog resolves to a real implementation, not NoopCatalog."],"tags":["iceberg","catalog","configuration","python"],"backgroundTag":"missing-required-config","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"}