test(pyamber): cover the source and batch operator final methods - #8047
Open
aglinxinyuan wants to merge 1 commit into
Open
test(pyamber): cover the source and batch operator final methods#8047aglinxinyuan wants to merge 1 commit into
aglinxinyuan wants to merge 1 commit into
Conversation
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8047 +/- ##
=========================================
Coverage 93.41% 93.42%
Complexity 4696 4696
=========================================
Files 1179 1179
Lines 47713 47713
Branches 5314 5314
=========================================
+ Hits 44573 44576 +3
+ Misses 1698 1695 -3
Partials 1442 1442
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 382 | 0.233 | 23,570/40,575/40,575 us | 🔴 +14.6% / 🔴 +193.1% |
| 🟢 | bs=100 sw=10 sl=64 | 818 | 0.499 | 119,100/142,907/142,907 us | 🟢 -16.8% / 🔴 +52.6% |
| ⚪ | bs=1000 sw=10 sl=64 | 938 | 0.572 | 1,065,257/1,117,696/1,117,696 us | ⚪ within ±5% / 🔴 +23.9% |
Baseline details
Latest main b01b11f from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 382 tuples/sec | 391 tuples/sec | 894.86 tuples/sec | -2.3% | -57.3% |
| bs=10 sw=10 sl=64 | MB/s | 0.233 MB/s | 0.239 MB/s | 0.546 MB/s | -2.5% | -57.3% |
| bs=10 sw=10 sl=64 | p50 | 23,570 us | 23,043 us | 11,139 us | +2.3% | +111.6% |
| bs=10 sw=10 sl=64 | p95 | 40,575 us | 35,399 us | 13,843 us | +14.6% | +193.1% |
| bs=10 sw=10 sl=64 | p99 | 40,575 us | 35,399 us | 16,839 us | +14.6% | +141.0% |
| bs=100 sw=10 sl=64 | throughput | 818 tuples/sec | 797 tuples/sec | 1,166 tuples/sec | +2.6% | -29.8% |
| bs=100 sw=10 sl=64 | MB/s | 0.499 MB/s | 0.486 MB/s | 0.711 MB/s | +2.7% | -29.9% |
| bs=100 sw=10 sl=64 | p50 | 119,100 us | 118,606 us | 87,509 us | +0.4% | +36.1% |
| bs=100 sw=10 sl=64 | p95 | 142,907 us | 171,661 us | 93,675 us | -16.8% | +52.6% |
| bs=100 sw=10 sl=64 | p99 | 142,907 us | 171,661 us | 102,153 us | -16.8% | +39.9% |
| bs=1000 sw=10 sl=64 | throughput | 938 tuples/sec | 930 tuples/sec | 1,198 tuples/sec | +0.9% | -21.7% |
| bs=1000 sw=10 sl=64 | MB/s | 0.572 MB/s | 0.568 MB/s | 0.731 MB/s | +0.7% | -21.8% |
| bs=1000 sw=10 sl=64 | p50 | 1,065,257 us | 1,069,991 us | 859,766 us | -0.4% | +23.9% |
| bs=1000 sw=10 sl=64 | p95 | 1,117,696 us | 1,174,820 us | 902,897 us | -4.9% | +23.8% |
| bs=1000 sw=10 sl=64 | p99 | 1,117,696 us | 1,174,820 us | 937,957 us | -4.9% | +19.2% |
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,523.87,200,128000,382,0.233,23569.68,40574.55,40574.55
1,100,10,64,20,2443.99,2000,1280000,818,0.499,119100.10,142907.38,142907.38
2,1000,10,64,20,21332.37,20000,12800000,938,0.572,1065256.98,1117696.39,1117696.39
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.
What changes were proposed in this PR?
test_operator.pygoes from 32 tests to 44, coveringSourceOperator.on_finishandBatchOperator's output-conversion arms.+5 fully-covered lines today, +7 after #8040, and the file reaches 100% branch coverage. Lines 233 and 234 are line-hit with one arm untaken, so today's branch-less CI report already scores them covered; closing their second arm is mutation-proven but invisible until #8040 lands.
This is a small PR and I would rather say so than dress it up. What makes it worth having is that it closes the file permanently: the five remaining gap lines (153, 177, 259, 293, 515) are
@abstractmethodbodies, and a grep ofsrc/main/pythonforsuper().process_tuple|produce|process_batch|process_table|conditionfinds zero production call sites. 178/183 is the ceiling, so nobody needs to re-derive this target.Scope narrowed during assessment, and the original plan is worth recording. This began as a three-file bundle also covering the four concrete partitioners and
proxy_server.py. Both were dropped on measurement: the partitioners' base class is bare-passstubs, andproxy_server.pyis already at 90/95 with a 268-line spec, leaving 2 honest lines. Onlyoperator.pysurvived.What matters about the two covered paths
SourceOperator.on_finishis the uncovered production path of every Python source UDF.BatchOperator._process_batch'sNoneand non-DataFrame arms decide what a batch operator emits when its handler returns nothing, or returns something that is not a DataFrame.Verification
Measured from
amber/with the identical full-suite scope on both sides,--cov-branchpassed explicitly (this branch lacks #8040's config), per-linehitsandcondition-coverageread out ofcoverage.xmlby script rather than from the summary percentage. The before-state used main's spec extracted viagit show HEAD:into a scratch dir and restored from that snapshot — nevergit restore.Two reviewers returned nine findings against the first draft; all repaired. Three mutants survive and are reported rather than dropped, all three genuinely equivalent:
!= 0to> 0on a list length (non-negative by construction), and deleting@overrides.finalfrom either method —overrides.finalistyping.final, which enforces nothing at runtime. The last two prompted a docstring correction, since the original text claimed finality as the reason the method was worth testing.Full pyamber suite:
5 failed, 1171 passed, 7 errorsagainst main's5 failed, 1159 passed, 7 errors. TheFAILED/ERRORnode-id sets were sorted and diffed — identical by identity, 12 entries.ruff checkandruff format --checkpass on CI's exact scope.git diff --numstatis226 0— zero deletions.No production file is touched;
git diff -- 'amber/src/main/*'is empty.Any related issues, documentation, discussions?
Closes #8043
How was this PR tested?
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)