Repository navigation
refactor(pyamber, infra, ci): remove dead code and settings - #9677
Conversation
Unused imports, bindings, helpers and settings have piled up outside the JVM and frontend code. Remove them from the Amber Python runtime, the Python test resources of the workflow compiler and operators, the licensing, local-dev and observability scripts, a few repository configuration files and three GitHub workflows. Each change keeps behaviour: Ruff settings that equal their defaults, a placeholder in a folder that now holds a real template, a duplicate ignore entry, a repeated include path, unread variables and fields, and an unreachable argument case.
Automated Reviewer SuggestionsBased on the
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 584 | 0.357 | 16,141/24,765/24,765 us | 🔴 +18.7% / 🔴 +74.5% |
| 🔴 | bs=100 sw=10 sl=64 | 1,237 | 0.755 | 79,195/111,530/111,530 us | 🔴 +24.3% / 🔴 +17.8% |
| ⚪ | bs=1000 sw=10 sl=64 | 1,466 | 0.895 | 687,186/723,263/723,263 us | ⚪ within ±5% / 🟢 -23.1% |
Baseline details
Latest main 89a492f from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 584 tuples/sec | 623 tuples/sec | 900.3 tuples/sec | -6.3% | -35.1% |
| bs=10 sw=10 sl=64 | MB/s | 0.357 MB/s | 0.38 MB/s | 0.549 MB/s | -6.1% | -35.0% |
| bs=10 sw=10 sl=64 | p50 | 16,141 us | 16,454 us | 11,014 us | -1.9% | +46.6% |
| bs=10 sw=10 sl=64 | p95 | 24,765 us | 20,868 us | 14,189 us | +18.7% | +74.5% |
| bs=10 sw=10 sl=64 | p99 | 24,765 us | 20,868 us | 17,391 us | +18.7% | +42.4% |
| bs=100 sw=10 sl=64 | throughput | 1,237 tuples/sec | 1,293 tuples/sec | 1,187 tuples/sec | -4.3% | +4.2% |
| bs=100 sw=10 sl=64 | MB/s | 0.755 MB/s | 0.789 MB/s | 0.724 MB/s | -4.3% | +4.2% |
| bs=100 sw=10 sl=64 | p50 | 79,195 us | 76,198 us | 86,789 us | +3.9% | -8.7% |
| bs=100 sw=10 sl=64 | p95 | 111,530 us | 89,716 us | 94,657 us | +24.3% | +17.8% |
| bs=100 sw=10 sl=64 | p99 | 111,530 us | 89,716 us | 104,753 us | +24.3% | +6.5% |
| bs=1000 sw=10 sl=64 | throughput | 1,466 tuples/sec | 1,486 tuples/sec | 1,219 tuples/sec | -1.3% | +20.3% |
| bs=1000 sw=10 sl=64 | MB/s | 0.895 MB/s | 0.907 MB/s | 0.744 MB/s | -1.3% | +20.3% |
| bs=1000 sw=10 sl=64 | p50 | 687,186 us | 670,834 us | 846,616 us | +2.4% | -18.8% |
| bs=1000 sw=10 sl=64 | p95 | 723,263 us | 721,522 us | 887,594 us | +0.2% | -18.5% |
| bs=1000 sw=10 sl=64 | p99 | 723,263 us | 721,522 us | 940,017 us | +0.2% | -23.1% |
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,342.39,200,128000,584,0.357,16141.29,24764.99,24764.99
1,100,10,64,20,1616.51,2000,1280000,1237,0.755,79195.35,111529.61,111529.61
2,1000,10,64,20,13642.60,20000,12800000,1466,0.895,687186.20,723263.36,723263.36
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9677 +/- ##
=========================================
Coverage 91.69% 91.69%
- Complexity 5125 5126 +1
=========================================
Files 1305 1305
Lines 58214 58208 -6
Branches 7594 7594
=========================================
- Hits 53377 53374 -3
+ Misses 2931 2930 -1
+ Partials 1906 1904 -2
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
kunwp1
left a comment
There was a problem hiding this comment.
LGTM!
Separately, bin/ and the test-resource python/ folders aren't linted in CI, which is how these leftovers built up. A follow-up could run ruff check on them too.
LargeBinaryOutputStream's docstrings now name the OSError its code raises, and _jsonify in py_op_driver.py base64-encodes value.removeprefix(...) directly instead of through a local copy.
What changes were proposed in this PR?
Remove unused imports, bindings, helpers and fields, and settings that repeat a default or another entry, from the Amber Python runtime, the Python test resources of the workflow compiler and operators, the
bin/licensing, local-dev and observability scripts, repository configuration, and three GitHub workflows (+102/-172 lines). There is no behavior change.StatisticsManagerusesdefaultdictinstead of the deprecatedtyping.DefaultDict, andBroadcastPartitionerbuilds its batch with[].LargeBinaryOutputStreamraises and documentsOSError(whichIOErroraliases), wraps its best-effort cleanup delete incontextlib.suppress, and drops thepassafterflush's docstring.py_op_driver.pydrops tenpytexeraimports andRAW_TYPE_MAPPINGthat it never reads. User code runs in its own namespace seeded byfrom pytexera import *, so the "used dynamically" note on those imports did not hold.compare.pydrops the uncalled_string_columnshelper and two dict copies ofdouble_kinds_a/double_kinds_e, andhf_parse_probe.pydrops unusedioandreimports. Quoted annotations,open(..., "r"),startswithplus a slice, and a placeholder-free f-string take their plain forms here and instandalone_worker.py,py_compile_worker.pyandhf_binary_value_probe.py.bin/scripts: the licensing tools use a tuplestartswith, read the one regex group they need instead of unpacking all four, print plain strings where f-strings had no placeholders, return aboolexpression directly, drop annotation quotes underfrom __future__ import annotations, useremovesuffix, and name unused loop values_. Two licensing tests drop# noqa: E402comments that suppress nothing under Ruff, andtest_local_dev_tui.pydrops the never-passedversionparameter of_seed_jvm_layouttogether with the docstring sentence about a jar it never wrote.bin/observability/smoke_test.pystops returning an unread status from_post, builds the trace id from oneuuid4().hex(the first 32 hex digits of two concatenated ones were always the first), and drops aleaked = Falsethat both branches of the followingtryoverwrite.amber/pyproject.tomldropsline-length = 88andmax-complexity = 10, which are Ruff's defaults (andC901is not selected)..dockerignoredrops a rootuser-resources/entry that its first rule,**/user-resources/, already covers.bin/fix-format.shdrops the""case thatTARGET="${1:-all}"makes unreachable, andbin/frontend-proto-gen.shdrops a--proto_paththat repeats its-I.bin/k8s/templates/aws/.gitkeepgoes, since the folder holdss3-credentials-secret.yaml.bin/y-websocket-server/package.jsondrops npm-init'smainand placeholdertestscript (the image runsnpx y-websocket), and abin/observability/docker-compose.ymlcomment stops pointing at astart_app.shthat the repository does not have.comment-commands.ymldropsgithub.event_name == 'issue_comment' && github.event.action == 'created'from three job conditions, because the workflow only runs onissue_comment: [created].pr-assignment.ymldrops a|| ''that follows atypeof ... === 'string'guard.benchmarks-pr-comment.ymlstops storing per-benchmark commit and date, a sample count and delta labels that nothing reads, takes each row's status from the deltas it already computed instead of a seconddeltaInfopass, reuses each metric's 7-day delta, and builds the PR-only CSV table only when there is no comparison to show.bin/scripts: #4387 (2026-04-29), #4668 (2026-05-02), #4693 (2026-05-02), #4711 (2026-05-03), #5057 (2026-05-15), #5417 (2026-06-10), #5961 (2026-06-28), #5377 (2026-10-28); configuration: #3019 (2024-11-20), #3335 (2025-03-23), #3441 (2025-05-19), #3890 (2025-10-14), #4005 (2025-10-29), #4105 (2025-12-05), #5757 (2026-06-24); workflows: #4885 (2026-05-03), #4986 (2026-05-08), #5148 (2026-05-22), #5557 (2026-06-11), #5639 (2026-06-12)issue_commentchecks: #4899 (2026-05-04,ci: drop the triage label, use is:open no:assignee filter) moved/takeout ofissue-triage.yml, which also ran onissuesevents, into a workflow that only runs on created comments, and #4986 and #5148 copied the checks into two new jobs;aws/.gitkeep: #5932 (2026-07-01,feat(k8s): make app-tier object storage configurable via storage.s3) added the folder's first template; PR-only CSV table: #5639 (2026-06-12,ci: compare benchmark PRs with main) shows it only when there is no comparison; everything else: unused or redundant since introductionAs of 2026-11-23, the unread test-resource code is under a week old, the
.gitkeepplaceholder and the unread benchmark fields have been redundant for about 5 months, theissue_commentchecks for over 6 months, and the duplicate.dockerignoreentry and--proto_pathfor 20 and 24 months.Any related issues, documentation, discussions?
Closes #9676.
How was this PR tested?
Ran on
525f8ce3fband onmainat89a492f97e(Windows 11, Python 3.12 with CI's pinnedruff0.14.7,pytest9.0.3 andtextual8.2.8, JDK 17):amber/(218 files already formatted) and on the 14 changed Python files outsideamber/.pytest -m "not integration"inamber/(JUnit XML): each of the 1,524 tests has the same outcome as onmain: 1,496 passed, 10 skipped, and the same 18 platform-dependent tests (Iceberg catalog on PostgreSQL ands3fs, time zones, object reprs) fail on this Windows machine on both.python -m pytest bin/(JUnit XML): each of the 196 tests has the same outcome as onmain: 186 passed, and ninebin/mountertests plustest_stamp_dir_for_matches_shell_sha1, which assume POSIX paths and shells, fail on Windows on both.UDF_PYTHON_PATHset to Python 3.12 because Windows has nopython3): these seven suites load the edited test resources.WorkflowCompilingServicepassed 52 of 52 in 4 suites andWorkflowOperator11 of 11 in 3 suites, with 0 canceled, the same as onmain.concat_license_binary.pywrites byte-identical combined licenses for the Python and frontend images, andcheck_binary_deps.py jarprints byte-identical reports and exit codes for a synthetic lib folder with missing, extra and version-mismatched jars, with and without--ignore-transitive-version.issue_comment,pull_request_targetandworkflow_run), so this PR's CI cannot run them. Each editedgithub-scriptbody ran before and after under Node with recording stubs forgithub,core,fsandfetch, over 496 fixtures (missing or malformed CSV and baseline data, failed API calls, body edits with and without closing references). Every API call, comment body and log line is identical, and a one-line change to each script does show up in its traces. Thecomment-commands.ymlconditions differ frommainonly by the two removed checks.bash -npasses onbin/fix-format.shandbin/frontend-proto-gen.sh, and the edited YAML, TOML and JSON files parse.f84888ca6cchanges only three docstrings inlarge_binary_output_stream.pyand inlines one local inpy_op_driver.py. On it, Ruff passes as above, each of the 1,524ambertests again has the same outcome as onmain, the fourWorkflowCompilingServicesuites pass 52 of 52, and_jsonifyreturns the same strings as on525f8ce3fbfor sevenBINARYinputs, with and without the pickle marker.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)