Skip to content

gfql: an alias named like the source, destination or edge-id binding column is not rejected (silent clobber on pandas/cuDF, raw polars SchemaError) #2050

Description

@lmeyerov

Summary

A node alias equal to the node-id binding column is rejected up front with GFQLValidationError on every engine. The three other binding columns are not guarded:

alias pandas / cuDF polars
edge alias = source column (name="s") served, but the marker overwrites the source column: result has no edges served with an extra s_right column
edge alias = destination column (name="d") served, destination column replaced by True ((3, True) edge pairs) served, extra d_right
edge alias = edge-id binding (name="eid") served, edge-id column replaced by True raw polars.exceptions.SchemaError: datatypes of join keys don't match (not a GFQL error)

Repro

import pandas as pd, graphistry
from graphistry.compute.ast import n, e_forward
nodes = pd.DataFrame({"key": [1, 2, 3], "id": [10, 20, 30]})
edges = pd.DataFrame({"s": [3, 3], "d": [1, 2], "type": ["HAS_CREATOR", "OTHER"], "eid": [100, 101]})
g = graphistry.nodes(nodes, "key").edges(edges, "s", "d", "eid")
ops = [n({"id": 30}, name="m"), e_forward({"type": "HAS_CREATOR"}, name="s"), n(name="p")]
g.gfql(ops)._edges          # empty on pandas; the seed's HAS_CREATOR edge is gone

Found by the alias/column collision probe run for the #2046 review.

Expected

The chain validator rejects an alias that equals any binding column (source, destination, edge id) the same way it rejects the node-id binding, on every engine, before execution.

Pins

Strict-xfail pins live in graphistry/tests/compute/test_chain_alias_column_collision.py (every engine) and flip when the validator covers these.

Activity

  1. lmeyerov commented on Oct 9, 2026

    @lmeyerov
    ContributorAuthor

    Verified resolved at master 599c405a234bff2402e4f76041cac6e169f6f7c8 (released runtime fixes are present in 0.60.0).

    All three edge binding aliases (s, d, eid) now raise structured E108 / field chain.name before execution on both gfql() and chain(). The common validator runs before engine resolution/coercion. A 24-case probe across requested pandas/Polars/cuDF/Polars-GPU dispatches confirms the rejection; this is pre-engine validation, not a claim of native GPU execution. Existing binding/node-alias tests also pass on native pandas and Polars: 16 passed; 8 unavailable cuDF cases were explicitly skipped.

    Reproduce the native CPU pins with python -m pytest -q graphistry/tests/compute/test_chain_alias_column_collision.py -k 'alias_named_like_a_binding_column or alias_named_like_the_node_binding'. The original silent endpoint/edge-ID overwrite is prevented, so this issue's requested validation is complete.

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