Skip to content

gfql polars: an edge alias that collides with the edge column its own filter uses raises incompatible-column-type (pandas serves it) #2039

Description

@lmeyerov

Summary

On the polars engine, a native op-list chain whose edge alias has the same name as an edge column that the same edge step filters on raises GFQLSchemaError [incompatible-column-type]. The pandas engine executes the same chain (alias marker authoritative over the colliding column, as combine_steps documents).

Same on 0.59.0 (3fb216dd1) with and without resident indexes, so it is independent of the fast paths and of the #2037/#2038 stack.

Repro

import pandas as pd, polars as pl, graphistry
from graphistry.compute.ast import n, e_forward

nodes = pd.DataFrame({"key": [1, 2, 3], "id": [10, 20, 30], "type": ["p", "p", "m"]})
edges = pd.DataFrame({"s": [3, 3], "d": [1, 2], "type": ["HAS_CREATOR", "OTHER"]})
ops = [n({"id": 30}, name="m"), e_forward({"type": "HAS_CREATOR"}, name="type"), n(name="p")]

g_pd = graphistry.nodes(nodes, "key").edges(edges, "s", "d")
g_pl = graphistry.nodes(pl.from_pandas(nodes), "key").edges(pl.from_pandas(edges), "s", "d")
print(g_pd.gfql(ops, engine="pandas")._edges.columns)   # ['s', 'd', 'type']  (marker replaced the column)
g_pl.gfql(ops, engine="polars")                          # GFQLSchemaError: column "type" is numeric but filter value is string

A node alias colliding with a node property (n({"id": 30}, name="id")) is served by both engines.

Expected

Both engines agree: either both serve with the documented marker-authoritative collision contract, or both reject the collision with a structured error before execution. The polars full path appears to tag the alias marker onto the edge frame before applying the step's own edge_match, so the filter then sees the boolean marker.

Context

Found while adding native op-list shapes to the pyg-bench SNB point-latency sentinel (the SNB frames carry id/type columns, so alias/column collisions are realistic). The native polars seeded fast path (#2038) declines alias collisions, so this is the full path. Related: #2034 (rows() duplicate/null ids).

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions