Commit 91e4a32
fix(gfql): keep policy-bearing queries off the native AUTO route
The routing change is only as safe as the set of inputs it refuses, and one
refusal is load-bearing rather than conservative.
The native polars executor does not go through `chain_impl`, so it never emits
the `postload` / `postchain` policy hooks that path emits. Measured on a
polars-frame graph: a policy that DENIES on `postload` blocks the query under
the generic path and does NOT block it under the native one. Routing a
policy-carrying query there would therefore have silently stopped enforcing a
denying postload policy for every user who never pinned an engine -- a
governance hook that stops firing is worse than a slow query. The NIE fallback
compounded it: re-running the query fired `preload` / `precompile` /
`postcompile` TWICE for one user call, so a policy that counts or rate-limits
would have double-counted.
`policy is None` in the guard restores both, exactly: the full hook trace and
every deny/allow outcome across all six hooks is now byte-identical to the
pre-change build on polars-frame graphs, pandas-frame graphs, and the declining
shape. Explicit `engine='polars'` is unchanged and still carries the
pre-existing hook gap; this only refuses to make that gap the default.
Tests: the positive half gains the edges-only graph (`self._nodes is None` is
inside the guard's condition, so it must actually work) and both spellings of
AUTO. A new negative class pins each refusal -- pandas frames, mixed
polars/pandas frames, explicit `engine='pandas'`, a denying postload policy
still blocking, and the compile/load hooks firing exactly once on a shape the
native engine declines.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015YsqAZQLbqjSDrYSFz2GoB1 parent 62239d2 commit 91e4a32
3 files changed
Lines changed: 93 additions & 3 deletions
File tree
- graphistry
- compute
- tests/compute/gfql
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1810 | 1810 | | |
1811 | 1811 | | |
1812 | 1812 | | |
1813 | | - | |
1814 | | - | |
1815 | | - | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
1816 | 1828 | | |
1817 | 1829 | | |
| 1830 | + | |
1818 | 1831 | | |
1819 | 1832 | | |
1820 | 1833 | | |
| |||
Lines changed: 76 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
0 commit comments