Commit 4dd0daa
* feat(gfql): native polars whole-entity count(DISTINCT n) via __gfql_node_id__ (#1709)
Resolve the bare `__gfql_node_id__` identity sentinel (emitted by whole-entity
aggregation lowering, e.g. RETURN count(DISTINCT b)) to the graph node-id column
in the polars row-expression lowering, mirroring pandas _gfql_resolve_token. The
prefixed `alias.__gfql_node_id__` form was already handled by _resolve_property;
only the single-source bare form declined (NIE on 'with_').
Published via a _NODE_ID contextvar alongside _SCHEMA; declines (NIE) when the id
column is unknown or absent so a multi-alias binding table never resolves to a
wrong/absent column. Differential fuzz vs pandas oracle: 600/600 value-identical.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6dQEcjdazEnzuvuwf73ZL
* docs(gfql): CHANGELOG [Development] entry for #1709 (native count(DISTINCT n))
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6dQEcjdazEnzuvuwf73ZL
* refactor(gfql): dedupe node-id sentinel + move polars lowering contextvars to a registry (review)
Review feedback on #1750: _NODE_ID_TOKEN was a bare literal duplicating the canonical
same_path_types.NODE_IDENTITY_COLUMN — now imports it. The polars-lowering contextvars
(_SCHEMA/_NODE_ID) move to a new per-engine registry lowering_context.py (the contextvar
analogue of reserved_columns.py), answering "per-engine or overall?" -> per-engine, since
they thread polars-specific lowering state. Registered lowering_context.py in the polars
per-file coverage baseline; dropped the now-unused `import contextvars`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6dQEcjdazEnzuvuwf73ZL
* refactor(gfql): type _lower_with_schema (table: pl.DataFrame, fn generic) (review)
Review feedback on #1750: _lower_with_schema(table: Any, fn) -> untyped. Now
table: pl.DataFrame, fn: Callable[[], _LowerT] -> _LowerT (the lowering result flows
through). mypy: 0 new errors; ruff clean; 175 tests pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6dQEcjdazEnzuvuwf73ZL
* fix(gfql): drop dead scalar-normalization branch in order_by_polars
lower_order_by_keys always returns List[bool] for descending flags, so the
isinstance(descending, list) ternary was statically dead and tripped mypy
[list-item] under py3.8 (List[bool] where bool expected). Use descending
directly for per-key nulls_last; behavior unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6dQEcjdazEnzuvuwf73ZL
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 983d2af commit 4dd0daa
5 files changed
Lines changed: 191 additions & 19 deletions
File tree
- graphistry
- compute/gfql/lazy/engine/polars
- tests/compute/gfql
- coverage_baselines
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
Lines changed: 36 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
| 18 | + | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
37 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
91 | | - | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
473 | 475 | | |
474 | 476 | | |
475 | 477 | | |
476 | | - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
477 | 488 | | |
478 | 489 | | |
479 | 490 | | |
| |||
625 | 636 | | |
626 | 637 | | |
627 | 638 | | |
628 | | - | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
629 | 644 | | |
630 | | - | |
631 | | - | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
632 | 649 | | |
633 | 650 | | |
634 | 651 | | |
635 | | - | |
| 652 | + | |
| 653 | + | |
636 | 654 | | |
637 | 655 | | |
638 | 656 | | |
| |||
652 | 670 | | |
653 | 671 | | |
654 | 672 | | |
655 | | - | |
| 673 | + | |
656 | 674 | | |
657 | 675 | | |
658 | 676 | | |
| |||
714 | 732 | | |
715 | 733 | | |
716 | 734 | | |
717 | | - | |
| 735 | + | |
718 | 736 | | |
719 | 737 | | |
720 | 738 | | |
| |||
729 | 747 | | |
730 | 748 | | |
731 | 749 | | |
732 | | - | |
| 750 | + | |
733 | 751 | | |
734 | 752 | | |
735 | 753 | | |
736 | 754 | | |
737 | 755 | | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
743 | 760 | | |
744 | 761 | | |
745 | 762 | | |
| |||
887 | 904 | | |
888 | 905 | | |
889 | 906 | | |
890 | | - | |
| 907 | + | |
891 | 908 | | |
892 | 909 | | |
893 | 910 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
0 commit comments