Skip to content

GFQL polars: HAS_<Label> aggregation shape diverges from pandas on duplicate-id graphs (no disambiguation, no decline) #1739

Description

@lmeyerov

Found by the #1737 review's test-coverage adversarial pass; pre-existing on master dbc6f628 (A/B-verified — NOT introduced by #1737, which covers only the binding_rows_polars path).

Repro

Fixture (same as _disambiguation_frames() in graphistry/tests/compute/gfql/test_polars_rows_entity_groupby.py): node id 400 duplicated across a Tag row (t4) and a Forum row (f4); edge 601 -HAS_TAG-> 400.

MATCH (post:Post {id: 601})-[:HAS_TAG]->(tag)
RETURN tag.name AS tagName, count(post) AS c
  • pandas: [{'tagName': 't4', 'c': 1}] (disambiguation narrows the unlabeled tag op to the HAS_TAG label row)
  • polars: [{'tagName': 'f4', 'c': 1}, {'tagName': 't4', 'c': 1}]

Silent divergence — violates the polars parity-or-NIE contract. The single-MATCH aggregating shape routes through a polars path that has no HAS_ destination disambiguation and never declined. The non-aggregating RETURN shape on the same fixture is parity-correct (covered by test_has_label_narrowing_applies_on_reached_collision).

Fix options

  1. Port the pandas _gfql_disambiguate_has_edge_destination_nodes gate to this path (probing pre-dedup base nodes — see feat(gfql): polars whole-entity aggregation Cypher — HAS_label disambiguation + identity-key + key_prefixes (LDBC IC4 native) #1737's binding_rows_polars gate for the base-graph plumbing via _gfql_rows_base_graph), or
  2. honest NIE decline for the gate shape on duplicate-id graphs (the feat(gfql): polars whole-entity aggregation Cypher — HAS_label disambiguation + identity-key + key_prefixes (LDBC IC4 native) #1737 resolution).

Either way, add a parity test pinning this exact aggregating shape.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions