Skip to content

gfql polars: the general (lowered) path fails on Cypher shapes that only the fast lanes serve #2059

Description

@lmeyerov

Summary

Found by route-off test amplification: with the four Cypher fast lanes forced to decline, shapes they normally serve fall to the lowered general path, which on polars does not serve them:

  • test_lowering.py::TestVarlenAliasHopGate::test_fixed_length_hop_is_not_gated → polars.exceptions.ColumnNotFoundError: "b.id" not found (the lowered projection path on polars).
  • test_seeded_typed_hop_fastpath.py::test_has_label_narrowing_*[polars] → NotImplementedError: polars engine does not yet natively support cypher row op 'rows' (the lowered path routes through the rows op the polars engine declines).

pandas and cuDF serve the same shapes on the general path. Consequence: on polars, a query variant that misses a lane's admission gate (one extra predicate, a different alias shape) gets an error instead of a slower answer — the lanes are masking a general-path gap rather than accelerating a working path.

Expected

The polars general path serves every shape a polars lane admits (the lanes are optimizations, not the only implementation), or the lane declines are typed and documented per shape.

Pins

The existing tests above, run with GFQL_ROUTES_OFF=cypher-fast (conftest switch from #2054), must pass; today they fail.

Activity

  1. lmeyerov commented on Sep 6, 2026

    @lmeyerov
    ContributorAuthor

    Re-checked at the #2061 head (master + #2055 + #2056 + the chain-specializations layout) with GFQL_ROUTES_OFF=cypher-fast:

    • test_lowering.py::TestVarlenAliasHopGate::test_fixed_length_hop_is_not_gated now passes with the lanes off (the "b.id" not found projection failure no longer reproduces on this tree).
    • test_polars_rows_entity_groupby.py::test_has_label_narrowing_applies_on_reached_collision[polars] still fails, but with the typed decline NotImplementedError: polars engine does not yet natively support cypher row op 'rows' … (no silent fallback; parity-or-error by design) raised from _run_calls_polars.

    So what remains is a capability gap, not a silent divergence: the polars general path has no native rows op, and the Cypher seeded lanes are today the only polars implementation of those RETURN shapes. The decline is already typed; what is missing is the per-shape documentation of which Cypher RETURN shapes on polars depend on a lane, or the native rows op itself. Leaving open as the capability item; the tck per-route ledger (tck-gfql bin/routes-off.sh) shows 0 masked scenarios on the TCK corpus with every lane off, so the gap is outside TCK shapes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions