Yicong-Huang opened a new pull request, #4664: URL: https://github.com/apache/texera/pull/4664
### What changes were proposed in this PR? Add a single test module `core/architecture/sendsemantics/test_partitioners.py` that exercises each concrete partitioner under that package: - `BroadcastPartitioner` - `RoundRobinPartitioner` - `OneToOnePartitioner` - `HashBasedShufflePartitioner` - `RangeBasedShufflePartitioner` For each one the suite covers: - constructor — receivers list, batch size, partitioner-specific attributes (hash keys, range bounds, worker_id matching, deduped channels) - `add_tuple_to_batch` — under-batch (no yield), at-batch (yield + slot reset), routing correctness - `flush` — pending-batch + ECM emitted only to the target receiver, empty-batch case, unknown-receiver case - `flush_state` — pending batches plus a per-receiver state record - `reset` — pending state cleared - `RangeBasedShufflePartitioner.get_receiver_index` — below `range_min`, above `range_max`, in-range quotient, boundary values Helper `_snapshot()` captures yielded list payloads at yield time, since several partitioners yield a receiver's pending batch by reference and clear it on the next statement of the generator. **Coverage on `core/architecture/sendsemantics/` rises from 56.6% to 99%.** All 5 concrete partitioner files reach 100%; the only remaining uncovered lines are the abstract-method `pass` stubs in the `Partitioner` base class. ``` Name Stmts Miss Cover core/architecture/sendsemantics/__init__.py 0 0 100% core/architecture/sendsemantics/broad_cast_partitioner.py 44 0 100% core/architecture/sendsemantics/hash_based_shuffle_partitioner.py 40 0 100% core/architecture/sendsemantics/one_to_one_partitioner.py 40 0 100% core/architecture/sendsemantics/partitioner.py 23 5 78% (abstract pass-stubs) core/architecture/sendsemantics/range_based_shuffle_partitioner.py 49 0 100% core/architecture/sendsemantics/round_robin_partitioner.py 39 0 100% TOTAL 474 5 99% ``` ### Any related issues, documentation, discussions? Closes #4663. ### How was this PR tested? \`\`\` $ python3 -m pytest core/architecture/sendsemantics/test_partitioners.py -v ... 35 passed in 0.65s $ python3 -m coverage run --source=core/architecture/sendsemantics -m pytest core/architecture/sendsemantics/test_partitioners.py $ python3 -m coverage report -m ... TOTAL 474 5 99% \`\`\` The new tests run under the existing python CI job (no new dependencies, no new fixtures needing infra). Codecov should pick the bump up automatically once the python job uploads coverage on this PR. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.7, 1M context) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
