{"record":{"id":"c0684cb74f66a4af","repo":"pola-rs/polars","slug":"iceberg-reader-override-native-failed-fallback-reason","errorCode":null,"errorMessage":"iceberg reader_override='native' failed: {fallback_reason}","messagePattern":"iceberg reader_override='native' failed: (.+?)","errorType":"exception","errorClass":"ComputeError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/io/iceberg/_dataset.py","lineNumber":589,"sourceCode":"                position_delete_files=position_delete_files,\n                deletion_vectors=deletion_vectors,\n                min_max_statistics=min_max_statistics,\n                statistics_loader=statistics_loader,\n                storage_options=storage_options,\n                row_count=(\n                    (total_physical_rows, total_deleted_rows)\n                    if (\n                        self.use_metadata_statistics\n                        and (self.fast_deletion_count or total_deleted_rows == 0)\n                    )\n                    else None\n                ),\n                snapshot_id_key=snapshot_id_key,\n            )\n\n        elif reader_override == \"native\":\n            msg = f\"iceberg reader_override='native' failed: {fallback_reason}\"\n            raise ComputeError(msg)\n\n        if verbose:\n            eprint(\n                \"IcebergScanResolver: to_dataset_scan(): \"\n                f\"fallback to python[pyiceberg] scan: {fallback_reason}\"\n            )\n\n        import polars.io.iceberg._utils\n\n        func = partial(\n            polars.io.iceberg._utils._scan_pyarrow_dataset_impl,\n            tbl,\n            snapshot_id=snapshot_id,\n            from_snapshot_id_exclusive=self.from_snapshot_id_exclusive,\n            to_snapshot_id_inclusive=self.to_snapshot_id_inclusive,\n            n_rows=limit,\n            with_columns=projection,\n            iceberg_table_filter=iceberg_table_filter,","sourceCodeStart":571,"sourceCodeEnd":607,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/io/iceberg/_dataset.py#L571-L607","documentation":"The fast 'native' (Rust) reader path could not handle this Iceberg table, and reader_override='native' explicitly forbade the automatic fallback to the Python pyiceberg reader. polars raises ComputeError carrying the original fallback_reason, replacing what would have been a silent fallback.","triggerScenarios":"Scanning a table whose features are unsupported by the native reader (e.g. certain partition transforms, deletes/equality deletes, unsupported formats) while forcing reader_override='native' so the pyiceberg fallback branch is rejected.","commonSituations":"Developers pin reader_override='native' for performance and then hit a table using advanced Iceberg features; version drift where a new table feature is not yet native-supported.","solutions":["Remove reader_override='native' (pass None) to allow automatic fallback to pyiceberg.","Set reader_override='pyiceberg' explicitly to force the Python reader.","Check the fallback_reason in the message to see which table feature the native reader lacks; simplify the table (e.g. remove unsupported deletes/transforms) if native reading is required."],"exampleFix":"// before\ndf = pl.scan_iceberg(uri, reader_override=\"native\").collect()  # fails on unsupported feature\n\n// after\ndf = pl.scan_iceberg(uri).collect()  # auto-fallback to pyiceberg when needed","handlingStrategy":"fallback","validationCode":"if requires_pyiceberg_features(table):\n    reader_override = \"pyiceberg\"  # or None to allow auto-fallback","typeGuard":"def native_reader_is_safe(reader_override: str | None) -> bool:\n    return reader_override in (None, \"pyiceberg\")","tryCatchPattern":"try:\n    df = pl.scan_iceberg(uri, reader_override=\"native\").collect()\nexcept pl.exceptions.ComputeError as e:\n    if \"reader_override='native' failed\" in str(e):\n        df = pl.scan_iceberg(uri, reader_override=\"pyiceberg\").collect()\n    else:\n        raise","preventionTips":["Don't force reader_override='native' unless you know the table only uses natively supported features.","Log fallback_reason when running with override='native' in CI to detect drift.","Pin a pyiceberg fallback path in production pipelines."],"tags":["iceberg","fallback","reader","compute-error"],"backgroundTag":"unsupported-operation","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"}