refactor: remove obsolete length argument from reverse aggregation calls - #1698
Open
samukweku wants to merge 2 commits into
Open
refactor: remove obsolete length argument from reverse aggregation calls#1698samukweku wants to merge 2 commits into
samukweku wants to merge 2 commits into
Conversation
Every _*_rev_* wrapper in _agg_functions.py (and the size_rev equivalents) still declared and forwarded a length: int parameter to janitor_rs. The Rust side never used it for anything but a HashMap::with_capacity() hint (or, for the plain starts/ends shape, didn't use it at all) -- see janitor-rs's own "drop the unused length parameter from every reverse kernel" change, which this is the matching Python-side half of. Removed length from every _*_rev_* wrapper's signature and from every call site in _get_join_aggs.py, including the now-dead length = ... local-variable computations that fed them. No accumulation logic or output changed. Add tests/functions/test_conditional_join_agg_boundary.py: focused, non-hypothesis tests that call each modified _agg_functions wrapper directly with a small hand-computed fixture (one per reverse-aggregation shape), plus a parametrized regression guard asserting none of the 37 touched wrappers declares a length parameter any more. These are intentionally narrower and faster than the existing `turtle`-marked property tests in test_conditional_join.py (which already cover this boundary end-to-end and continue to pass) -- the point here is to catch a Python/Rust signature mismatch specifically, the failure mode this whole change is about. Verified against a janitor-rs build carrying the matching Rust-side removal: all 49 new tests pass, and the full existing test_conditional_join.py suite passes (242 passed, 1 skipped; the only 36 failures are a missing optional `numba` dependency in the verification env, unrelated to this change). This lands only once janitor-rs ships a release with the matching Rust-side length removal -- until then it will raise `TypeError: unexpected keyword argument 'length'` against the currently pinned janitor-rs range (>=0.6.1,<0.7). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KoekYAMwQGYVJqypwtUJf9
samukweku
force-pushed
the
audit-rev-ranges-remove-length
branch
from
August 28, 2026 02:02
6922544 to
c5cb7e5
Compare
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every
_*_rev_*wrapper in_agg_functions.py(and thesize_revequivalents) still declared and forwarded a
length: intparameter tojanitor_rs. On the Rust side that parameter was already obsoleteeverywhere it survived -- either unused entirely (the plain
starts/endsshape derives its own bound from
index.len()) or only ever feeding aHashMap::with_capacity()preallocation hint, never correctness orbounds-checking. This is the Python-side half of janitor-rs's own
"drop the unused
lengthparameter from every reverse kernel" change.What changed
lengthfrom every_*_rev_*wrapper's signature in_agg_functions.py, and from every call site (plus the now-deadlength = ...local-variable computations that fed them) in_get_join_aggs.py. No accumulation logic or output changed.tests/functions/test_conditional_join_agg_boundary.py: focused,non-hypothesis tests that call each modified
_agg_functionswrapperdirectly with a small hand-computed fixture -- one per reverse-aggregation
shape (
no_range,starts,ends,starts_matches,ends_matches,starts_ends,starts_ends_matches,positions, plussize'sno-
arr/booleansvariants) -- and a parametrized regression guardasserting none of the 37 touched wrappers declares a
lengthparameterany more. These are intentionally narrower and faster than the existing
turtle-marked property tests intest_conditional_join.py(whichalready cover this boundary end-to-end and continue to pass unchanged);
the point here is to catch a Python/Rust signature mismatch specifically
-- the exact failure mode this whole change is about.
Testing
Verified against a janitor-rs build carrying the matching Rust-side
removal:
test_conditional_join_agg_boundary.py: all pass.test_conditional_join.pysuite: 242 passed, 1skipped. The only 36 failures were
ModuleNotFoundError: No module named 'numba'from a missing optional dependency in the verificationenvironment -- unrelated to this change (a separate, numba-accelerated
code path that never touches
_agg_functions.py/_get_join_aggs.py).Before merging
This needs a janitor-rs release with the matching Rust-side
lengthremoval -- until then, every touched call will raise
TypeError: unexpected keyword argument 'length'against the currentlypinned range (
janitor-rs>=0.6.1,<0.7). Landing order should bejanitor-rs first, then this.
Scope
Rebased directly onto current
dev(previously stacked on the unmerged1649-simplify-conditional-join-rust-boundarybranch, which this nolonger depends on) and expanded to cover every remaining shape that still
had
length, not just the narrowerno_range/size/prod_starts_matchessubset the branch covered before. #1684, #1686, and #1690 remain separate,
untouched PRs.