Skip to content

feat(pyamber): reject empty tuples - #8218

Open
carloea2 wants to merge 1 commit into
apache:mainfrom
carloea2:fix/empty-tuple-validation
Open

feat(pyamber): reject empty tuples#8218
carloea2 wants to merge 1 commit into
apache:mainfrom
carloea2:fix/empty-tuple-validation

Conversation

@carloea2

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Replace the removable empty-tuple assert with an explicit ValueError.

Existing coverage for empty lists, dictionaries, and pandas Series now verifies the stable exception, including optimized Python.

Any related issues, documentation, discussions?

Closes #8217

How was this PR tested?

python -c "import sys,pytest; sys.path[:0]=[r'<worktree>ambersrcmainpython',r'<main-checkout>ambersrcmainpython']; raise SystemExit(pytest.main([r'amber/src/test/python/core/models/test_tuple.py','-q','-p','no:cacheprovider','-k','not test_hash']))"
101 passed, 2 deselected

python -O -c "import sys,pytest; sys.path[:0]=[r'<worktree>ambersrcmainpython',r'<main-checkout>ambersrcmainpython']; raise SystemExit(pytest.main([r'amber/src/test/python/core/models/test_tuple.py::TestTuple::test_reject_empty_tuplelike','-q','-p','no:cacheprovider']))"
1 passed

ruff check amber/src/main/python amber/src/test/python
All checks passed

ruff format --check amber/src/main/python amber/src/test/python
213 files already formatted

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Codex

@Yicong-Huang Yicong-Huang added the release/v1.2 back porting to release/v1.2 label Aug 31, 2026
@github-actions
github-actions Bot requested a review from xuang7 August 31, 2026 03:35
@github-actions

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. release/* labels drive the post-merge backport, so add or remove one to change where this fix lands.

Release branch Analysis
⚠️ release/v1.3 Not labeled automatically — none of the files this PR modifies exist on this branch (amber/src/main/python/core/models/tuple.py, amber/src/test/python/core/models/test_tuple.py). The fix may target code that isn't on this release, or the files were moved/renamed after the branch was cut. Please check and add release/v1.3 by hand if this fix should be backported here.
release/v1.2 Change detected on this branch — label added; this fix is queued to backport here. Requested review from @xuang7.

Auto-label run.

@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @eugenegujing, @aglinxinyuan
    You can notify them by mentioning @eugenegujing, @aglinxinyuan in a comment.

@codecov-commenter

codecov-commenter commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.91%. Comparing base (70c2114) to head (2f821a8).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8218      +/-   ##
============================================
- Coverage     93.94%   93.91%   -0.04%     
  Complexity     4759     4759              
============================================
  Files          1185     1185              
  Lines         48069    48813     +744     
  Branches       5359     5359              
============================================
+ Hits          45159    45841     +682     
- Misses         1480     1542      +62     
  Partials       1430     1430              
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from 70c2114
agent-service 99.32% <ø> (ø) Carriedforward from 70c2114
amber 89.99% <ø> (ø) Carriedforward from 70c2114
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from 70c2114
config-service 86.86% <ø> (ø) Carriedforward from 70c2114
file-service 87.91% <ø> (ø) Carriedforward from 70c2114
frontend 96.49% <ø> (ø) Carriedforward from 70c2114
notebook-migration-service 79.31% <ø> (ø) Carriedforward from 70c2114
pyamber 97.87% <100.00%> (-1.01%) ⬇️
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from 70c2114

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

✅ No material benchmark regressions detected

🟢 9 better · 🔴 0 worse · ⚪ 6 noise (<±5%) · 0 without baseline

Compared against main 70c2114 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🟢 bs=10 sw=10 sl=64 380 0.232 24,707/35,318/35,318 us 🟢 -41.1% / 🔴 +126.7%
🟢 bs=100 sw=10 sl=64 786 0.479 126,886/153,439/153,439 us 🟢 -20.6% / 🔴 +43.1%
🟢 bs=1000 sw=10 sl=64 902 0.55 1,109,632/1,149,802/1,149,802 us 🟢 -6.9% / 🔴 -13.5%
Baseline details

Latest main 70c2114 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 380 tuples/sec 317 tuples/sec 787.98 tuples/sec +19.9% -51.8%
bs=10 sw=10 sl=64 MB/s 0.232 MB/s 0.193 MB/s 0.481 MB/s +20.2% -51.8%
bs=10 sw=10 sl=64 p50 24,707 us 31,974 us 12,593 us -22.7% +96.2%
bs=10 sw=10 sl=64 p95 35,318 us 59,930 us 15,579 us -41.1% +126.7%
bs=10 sw=10 sl=64 p99 35,318 us 59,930 us 18,786 us -41.1% +88.0%
bs=100 sw=10 sl=64 throughput 786 tuples/sec 787 tuples/sec 1,008 tuples/sec -0.1% -22.0%
bs=100 sw=10 sl=64 MB/s 0.479 MB/s 0.48 MB/s 0.615 MB/s -0.2% -22.1%
bs=100 sw=10 sl=64 p50 126,886 us 121,223 us 100,701 us +4.7% +26.0%
bs=100 sw=10 sl=64 p95 153,439 us 193,255 us 107,244 us -20.6% +43.1%
bs=100 sw=10 sl=64 p99 153,439 us 193,255 us 116,122 us -20.6% +32.1%
bs=1000 sw=10 sl=64 throughput 902 tuples/sec 914 tuples/sec 1,042 tuples/sec -1.3% -13.4%
bs=1000 sw=10 sl=64 MB/s 0.55 MB/s 0.558 MB/s 0.636 MB/s -1.4% -13.5%
bs=1000 sw=10 sl=64 p50 1,109,632 us 1,095,694 us 981,959 us +1.3% +13.0%
bs=1000 sw=10 sl=64 p95 1,149,802 us 1,234,863 us 1,023,080 us -6.9% +12.4%
bs=1000 sw=10 sl=64 p99 1,149,802 us 1,234,863 us 1,051,697 us -6.9% +9.3%
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,526.93,200,128000,380,0.232,24707.20,35318.40,35318.40
1,100,10,64,20,2545.85,2000,1280000,786,0.479,126885.97,153439.09,153439.09
2,1000,10,64,20,22176.51,20000,12800000,902,0.550,1109631.99,1149802.10,1149802.10

@carloea2 carloea2 changed the title fix(pyamber): reject empty tuples feat(pyamber): reject empty tuples Aug 31, 2026
@mengw15 mengw15 removed the release/v1.2 back porting to release/v1.2 label Aug 31, 2026
@xuang7 xuang7 removed the fix label Sep 1, 2026
@xuang7
xuang7 removed their request for review September 1, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimized Python silently drops empty tuples

5 participants