Skip to content

test+docs(gfql): pin cache-key completeness, shrink two row_pipeline docstrings - #1866

Merged
lmeyerov merged 1 commit into
masterfrom
docs/gfql-row-pipeline-diet
Aug 11, 2026
Merged

test+docs(gfql): pin cache-key completeness, shrink two row_pipeline docstrings#1866
lmeyerov merged 1 commit into
masterfrom
docs/gfql-row-pipeline-diet

Conversation

@lmeyerov

Copy link
Copy Markdown
Contributor

Applying the settled rule to row_pipeline.py, the largest remaining prose file — and coverage check first, which is the correction from #1864.

The split

_order_keys_hold_list_like_values (21 lines) has 18 tests, so its trigger enumeration is already specified. It becomes a pointer.

_single_alias_cache_key (25 lines) had one test, and that one is about clearing the memo, not keying it. Its two real claims were unpinned — and a wrong cache key serves a stale expression, which is a silent wrong answer no existing test would catch. So per the rule: add the test.

New: test_single_alias_cache_key.py

  • dtype must be in the key — names alone would serve a float expression for a string column
  • parameterized dtypes must not collide, with Datetime == Datetime('ns') asserted so the hazard is visible rather than described
  • expr / alias / nan_free / schema-order all keyed; key hashable and stable

What survives in prose

The str(dtype) rationale, why parser availability is deliberately unkeyed (a process property, not an argument — so no entry outlives a departed parser), and the directive not to tighten an intentionally-broad decline: over-declining costs a fallback, under-declining returns a silently wrong order.

Both registered in POLARS_TEST_FILES and guarded with importorskip — both halves of yesterday's lane lesson.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MF7uRZLKZaD6Q9FGWSmyXi

… two docstrings

Applying the settled rule to row_pipeline.py, largest remaining prose file.

Coverage check first (the lesson from #1864): _order_keys_hold_list_like_values
has 18 tests, so its trigger enumeration is already specified -- it becomes a
pointer. _single_alias_cache_key had ONE, about clearing rather than keying, so
its two real claims were unpinned. A wrong cache key serves a stale expression:
a silent wrong answer no existing test would catch.

Added test_single_alias_cache_key.py: dtype must be in the key (names alone would
serve a float expression for a string column), parameterized dtypes must not
collide -- with  asserted so the hazard is visible
rather than described -- plus expr/alias/nan_free/schema-order, hashability.

Both docstrings then drop to ~11 lines, keeping only what tests cannot say: the
str(dtype) rationale, why parser availability is deliberately unkeyed, and the
directive not to tighten an intentionally-broad decline (over-declining costs a
fallback, under-declining returns a wrong ORDER).

Registered in POLARS_TEST_FILES and guarded with importorskip -- both halves of
yesterday's lane lesson.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MF7uRZLKZaD6Q9FGWSmyXi
@lmeyerov
lmeyerov merged commit 29e3f53 into master Aug 11, 2026
77 checks passed
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