Summary
On the ibis-polars backend, Relation.with_row_index(...) raises ibis.common.exceptions.OperationNotDefinedError: No translation rule for <class 'ibis.expr.operations.window.WindowFunction'>. The ibis polars backend has no window-function translator, so any relation operation that compiles to a WindowFunction node is unusable on that backend.
Reproduction
import polars as pl
import ibis
from mountainash.relations import relation
conn = ibis.polars.connect()
tbl = conn.create_table("t", pl.DataFrame({"x": [3, 1, 2]}), overwrite=True)
rel = relation(tbl).with_row_index(name="__rank")
rel.collect()
# ibis.common.exceptions.OperationNotDefinedError:
# No translation rule for <class 'ibis.expr.operations.window.WindowFunction'>
Other ibis backends (ibis-duckdb, ibis-sqlite) handle the same operation fine — this is specific to ibis-polars.
Impact
Blocks cross-backend parameterisation of mountainash-utils-rules tests on ibis-polars. The rules engine uses with_row_index to assign __rank after sorting by specificity. Currently tracked via non-strict xfail in mountainash-utils-rules/tests/conftest.py::UPSTREAM_BROKEN_BACKENDS.
Possible paths
- Upstream ibis adds a polars backend translator for
WindowFunction.
- Mountainash's narwhals/ibis-polars code path detects the limitation and falls back to a non-window row-number implementation (e.g. compute via materialized sort + enumerate).
- Mountainash documents
ibis-polars as not supporting window operations and drops it from the default backend matrix for window-using relations.
Leaning toward option 1 as the right long-term fix — window functions are a core SQL feature and the ibis-polars gap is clearly a missing translator, not a design decision.
Summary
On the
ibis-polarsbackend,Relation.with_row_index(...)raisesibis.common.exceptions.OperationNotDefinedError: No translation rule for <class 'ibis.expr.operations.window.WindowFunction'>. The ibis polars backend has no window-function translator, so any relation operation that compiles to a WindowFunction node is unusable on that backend.Reproduction
Other ibis backends (
ibis-duckdb,ibis-sqlite) handle the same operation fine — this is specific toibis-polars.Impact
Blocks cross-backend parameterisation of
mountainash-utils-rulestests onibis-polars. The rules engine useswith_row_indexto assign__rankafter sorting by specificity. Currently tracked via non-strict xfail inmountainash-utils-rules/tests/conftest.py::UPSTREAM_BROKEN_BACKENDS.Possible paths
WindowFunction.ibis-polarsas not supporting window operations and drops it from the default backend matrix for window-using relations.Leaning toward option 1 as the right long-term fix — window functions are a core SQL feature and the ibis-polars gap is clearly a missing translator, not a design decision.