Skip to content

Commit eeba277

Browse files
thodson-usgsclaude
andcommitted
docs(tests): Drop stale "two-decorator design" references in test prose
Three test docstrings/comments still framed their reasoning against the removed two-decorator stack (PR DOI-USGS#283 unified them). Reword to describe the current joint-planner behavior on its own terms: - ``test_plan_joint_fans_out_filter_when_list_alone_cannot_fit``: drop the "previous two-decorator design" aside. - ``test_chunkable_params_skips_filter_passed_as_list``: rewrite the "inner filters.chunked is the only place that may shrink filter" line to point at ``_plan_joint``. - ``stress_chunker._bail_floor_baseline``: reframe the baseline as "degenerate singleton plan" rather than "worst case the old two-decorator design produced." No behavioral changes; prose only. Chunker tests + offline stress test still pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f16555d commit eeba277

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

tests/stress_chunker.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
1818
Plus a greedy-quality check: for the "long filter + long lists"
1919
scenario, the joint planner should comfortably beat the bail-floor-only
20-
baseline (the worst case the old two-decorator design produced).
20+
baseline (singleton list chunks × one clause per filter chunk — the
21+
worst sensible plan, used as the floor the greedy planner has to beat).
2122
2223
Run: ``python3 tests/stress_chunker.py``.
2324
"""
@@ -86,10 +87,10 @@ def _query_params(url: str) -> dict[str, str]:
8687

8788

8889
def _bail_floor_baseline(args: dict, url_limit: int) -> int:
89-
"""Lower-bound on what a singleton-list + singleton-clause plan
90-
would produce — the worst case the old two-decorator design could
91-
have hit. Used as the optimization-quality bar for the joint
92-
planner: it should beat this comfortably.
90+
"""Upper bound: the sub-request count a degenerate plan that
91+
singleton-chunks every list dim AND emits one clause per filter
92+
sub-request would produce. The joint planner should beat this
93+
comfortably — it's the quality bar.
9394
9495
Counts ``product(per-dim length) × n_clauses`` for the inputs that
9596
are eligible to chunk."""

tests/waterdata_test.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,7 @@ def test_plan_chunks_raises_request_too_large_at_singleton_floor():
329329
def test_plan_joint_fans_out_filter_when_list_alone_cannot_fit():
330330
"""When the request can only fit by chunking BOTH the list and the
331331
filter, the joint planner must produce a plan that touches both
332-
dims. With the previous two-decorator design the inner filter
333-
chunker would have shrunk the filter at runtime; the joint planner
334-
surfaces the same outcome at plan time."""
332+
dims."""
335333
clauses = [f"f='{i}'" for i in range(10)]
336334
args = {
337335
"monitoring_location_id": ["A" * 10, "B" * 10, "C" * 10, "D" * 10],
@@ -750,8 +748,9 @@ def test_chunkable_params_skips_filter_passed_as_list():
750748
"""Defensive guard: ``filter`` is documented as a string. If a caller
751749
mistakenly passes it as a list, the chunker must NOT treat it as a
752750
multi-value dim — comma-joining CQL clauses inside the URL would
753-
produce a malformed filter expression. The inner ``filters.chunked``
754-
is the only place that may shrink ``filter``."""
751+
produce a malformed filter expression. The joint planner partitions
752+
``filter`` via top-level ``OR`` splitting in ``_plan_joint``; it must
753+
never be sliced as a list dim."""
755754
args = {
756755
"monitoring_location_id": ["USGS-A", "USGS-B"],
757756
"filter": ["a='1'", "a='2'"], # malformed input

0 commit comments

Comments
 (0)