Skip to content

test(gfql): pin list-column ORDER BY prefix-tie-break semantics (#1359) - #1360

Merged
lmeyerov merged 1 commit into
masterfrom
issue-1359-with-orderby-wrong-rows
May 9, 2026
Merged

lmeyerov merged 1 commit into
masterfrom
issue-1359-with-orderby-wrong-rows

Conversation

@lmeyerov

@lmeyerov lmeyerov commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds test_row_pipeline_order_by_list_column_matches_opencypher_prefix_tie_break to graphistry/tests/compute/gfql/test_row_pipeline_ops.py.
  • Pins build_list_sort_columns openCypher-correct behavior for prefix-tied list keys: shorter list ranks before longer when prefix elements are equal ([2, -2] < [2, -2, 100]).
  • Mirrors openCypher TCK clauses/with-orderBy/WithOrderBy1.feature scenarios [31]/[32] using proper Python-list values.

Context

Triage for #1353 item #1 / #1359 wrong-row tranche showed pygraphistry's list-sort is correct when given Python lists; the 14 wrong-row classifications are tck-gfql repo issues, tracked in tck-gfql#36:

  1. parse_cypher.py::_parse_properties stores list literals as strings, so the row pipeline never sees a list-typed column.
  2. _rows_ordered forces ordered comparison even when the openCypher feature says "in any order".

This PR adds a defensive test so future row-pipeline work doesn't silently regress the (currently correct) list comparator + prefix-tie-break behavior. No production code change.

#1359 stays open until tck-gfql#36 lands and the contract count drops.

Test plan

  • pytest graphistry/tests/compute/gfql/test_row_pipeline_ops.py (178 passed, 5 skipped locally)
  • ./bin/ruff.sh graphistry/tests/compute/gfql/test_row_pipeline_ops.py
  • CI green

Locks in `build_list_sort_columns` openCypher-correct behavior for
prefix-tied list keys: shorter list ranks before longer when prefix
elements are equal (`[2, -2] < [2, -2, 100]`). Mirrors the openCypher
TCK clauses/with-orderBy/WithOrderBy1.feature [31]/[32] fixture using
proper Python-list values.

Triage for #1353 item #1 / #1359 wrong-row tranche showed pygraphistry's
list-sort is correct when given Python lists; the 14 wrong-row
classifications are tck-gfql repo issues (parser stores list literals
as strings; runner forces ordered comparison even when feature says
"in any order"). Tracked in tck-gfql#36.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant