{"record":{"id":"cfe17b1813d21ebf","repo":"pola-rs/polars","slug":"unknown-call-f-r","errorCode":null,"errorMessage":"Unknown call: {f!r}","messagePattern":"Unknown call: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/io/iceberg/_utils.py","lineNumber":282,"sourceCode":"    f = _convert_predicate(a.func)\n    if f == \"field\":\n        return args\n    elif f == \"scalar\":\n        return args[0]\n    elif f in _temporal_conversions:\n        # convert from polars-native i64 to ISO8601 string\n        return _temporal_conversions[f](*args).isoformat()\n    else:\n        ref = _convert_predicate(a.func.value)[0]  # type: ignore[attr-defined]\n        if f == \"isin\":\n            return pyiceberg.expressions.In(ref, args[0])  # type: ignore[misc, call-arg]\n        elif f == \"is_null\":\n            return pyiceberg.expressions.IsNull(ref)  # type: ignore[misc]\n        elif f == \"is_nan\":\n            return pyiceberg.expressions.IsNaN(ref)  # type: ignore[misc]\n\n    msg = f\"Unknown call: {f!r}\"\n    raise ValueError(msg)\n\n\n@_convert_predicate.register(Attribute)\ndef _(a: Attribute) -> Any:\n    return a.attr\n\n\n@_convert_predicate.register(BinOp)\ndef _(a: BinOp) -> Any:\n    lhs = _ensure_boolean_expression(_convert_predicate(a.left))\n    rhs = _ensure_boolean_expression(_convert_predicate(a.right))\n\n    op = a.op\n    if isinstance(op, BitAnd):\n        return pyiceberg.expressions.And(lhs, rhs)\n    if isinstance(op, BitOr):\n        return pyiceberg.expressions.Or(lhs, rhs)\n    else:","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/io/iceberg/_utils.py#L264-L300","documentation":"A Call node in the pyarrow predicate AST is translated only for known function names (e.g. is_null, is_nan). If the walker resolves a call to a function name it does not recognize, it raises ValueError('Unknown call: ...') because there is no pyiceberg equivalent mapping.","triggerScenarios":"Passing a pyarrow.compute filter that calls an unsupported function, e.g. `pc.field('a').is_valid()`, `pc.utf8_is_alphanumeric(...)`, or any compute kernel invocation not in polars' mapping table, when scanning Iceberg with a pyarrow filter.","commonSituations":"Using rich pyarrow compute kernels inside scan_iceberg filters; typos in supported calls (is_null vs is_valid); version differences where newer pyarrow adds functions polars doesn't map yet.","solutions":["Restrict filter calls to supported ones: is_null, is_nan (and comparison/boolean operators)","Filter unsupported conditions after loading: use polars `.filter()` on the resulting DataFrame/LazyFrame","Rewrite the condition using supported semantics, e.g. `~pc.field('a').is_null()` instead of `is_valid()`","Check polars' `_convert_predicate` Call mapping for the exact supported set, or upgrade polars"],"exampleFix":"// before\npc.field('name').is_valid()  # Unknown call\n// after\n~pc.field('name').is_null()  # supported\n// or filter downstream: df.filter(pl.col('name').is_not_null())","handlingStrategy":"try-catch","validationCode":"SUPPORTED_CALLS = {'is_null', 'is_nan'}\ndef calls_supported(expr) -> bool:\n    import ast\n    return all(\n        (n.func.attr if isinstance(n.func, ast.Attribute) else '') in SUPPORTED_CALLS\n        for n in ast.walk(expr) if isinstance(n, ast.Call)\n    )","typeGuard":null,"tryCatchPattern":"try:\n    lf = pl.scan_iceberg(src, filter=pred)\nexcept ValueError as e:\n    if 'Unknown call' in str(e):\n        lf = pl.scan_iceberg(src).filter(downstream_condition)","preventionTips":["Limit filter functions to is_null and is_nan","Handle is_valid as `~field.is_null()`","Push down only predicate-capable conditions; filter the rest post-load","Check polars' Call mapping when adding new filters"],"tags":["iceberg","predicate","pyarrow","unsupported-function"],"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"}