You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "eugenegujing (via GitHub)" <gi...@apache.org> on 2026/08/11 21:49:11 UTC
[PR] test(workflow-operator): cover the vectorizer branches of Sklearn code generation [texera]
eugenegujing opened a new pull request, #7577:
URL: https://github.com/apache/texera/pull/7577
### What changes were proposed in this PR?
This PR adds unit test coverage for the vectorizer branches of the Python code generation in the two shared Sklearn base descriptors:
- `SklearnTrainingOpDesc` (base of the 26 Sklearn training operators)
- `SklearnClassifierOpDesc` (base of the 25 Sklearn classifier operators)
Both templates branch on the `countVectorizer` and `tfidfTransformer` properties to select the text column and prepend `CountVectorizer()` / `TfidfTransformer()` stages to the generated `make_pipeline` call, but no test in the repository generated code with either flag set: every existing `generatePythonCode()` assertion runs with both flags default-false, and the specs that do set `countVectorizer = true` are Jackson round-trip tests that never invoke code generation.
Two new specs exercise each base through a representative concrete subclass (`SklearnTrainingKNNOpDesc` / `SklearnKNNOpDesc`), matching how the operators use the bases:
- `SklearnTrainingOpDescCodegenSpec` (4 tests)
- `SklearnClassifierOpDescCodegenSpec` (4 tests)
Each spec covers all four flag combinations the templates distinguish, with positive and negative assertions: the both-false baseline (whole-feature path, no vectorizer stages), `countVectorizer` alone (text-column selection plus `CountVectorizer()` stage), both flags (stage order asserted via the full `make_pipeline(CountVectorizer(), TfidfTransformer(), ...)` call), and `tfidfTransformer` alone (a reachable codegen branch even though the UI hides the field when `countVectorizer` is off). Attribute names are `EncodableString`s, so the expected values are built with the production `PythonTemplateBuilder.wrapWithPythonDecoderExpr`, pinning the real base64 decode expressions in the generated code.
No production code is changed.
### Any related issues, documentation, discussions?
Closes #7574
### How was this PR tested?
This PR is itself test-only. The new specs were run with:
```
sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.sklearn.SklearnClassifierOpDescCodegenSpec org.apache.texera.amber.operator.sklearn.training.SklearnTrainingOpDescCodegenSpec"
```
All 8 tests pass. The suite was additionally mutation-checked: six manual template mutations (swapping the `CountVectorizer`/`TfidfTransformer` stage order, gating the text-column selection on the wrong flag, and ignoring the `tfidfTransformer` flag, in each base) each caused test failures, and the sources were restored afterwards. `scalafmtCheck` passes.
### Was this PR authored or co-authored using generative AI tooling?
Co-authored by: Claude Code (Claude Fable 5)
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(workflow-operator): cover the vectorizer branches of Sklearn code generation [texera]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #7577:
URL: https://github.com/apache/texera/pull/7577#issuecomment-5259274072
## [Codecov](https://app.codecov.io/gh/apache/texera/pull/7577?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 87.88%. Comparing base ([`e878df3`](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`03eb82e`](https://app.codecov.io/gh/apache/texera/commit/03eb82e210d4dd027b3d8f6122dac22dac5abab8?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #7577 +/- ##
=========================================
Coverage 87.88% 87.88%
Complexity 4276 4276
=========================================
Files 1176 1176
Lines 47018 47018
Branches 5245 5245
=========================================
Hits 41323 41323
Misses 3972 3972
Partials 1723 1723
```
| [Flag](https://app.codecov.io/gh/apache/texera/pull/7577/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | *Carryforward flag |
|---|---|---|---|
| [access-control-service](https://app.codecov.io/gh/apache/texera/pull/7577/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.00% <ø> (ø)` | | Carriedforward from [e878df3](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [agent-service](https://app.codecov.io/gh/apache/texera/pull/7577/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `98.62% <ø> (ø)` | | Carriedforward from [e878df3](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [amber](https://app.codecov.io/gh/apache/texera/pull/7577/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `82.88% <ø> (ø)` | | Carriedforward from [e878df3](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [computing-unit-managing-service](https://app.codecov.io/gh/apache/texera/pull/7577/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `60.38% <ø> (ø)` | | Carriedforward from [e878df3](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [config-service](https://app.codecov.io/gh/apache/texera/pull/7577/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `65.97% <ø> (ø)` | | |
| [file-service](https://app.codecov.io/gh/apache/texera/pull/7577/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `69.05% <ø> (ø)` | | Carriedforward from [e878df3](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [frontend](https://app.codecov.io/gh/apache/texera/pull/7577/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `89.94% <ø> (ø)` | | Carriedforward from [e878df3](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [notebook-migration-service](https://app.codecov.io/gh/apache/texera/pull/7577/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `78.89% <ø> (ø)` | | |
| [pyamber](https://app.codecov.io/gh/apache/texera/pull/7577/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `97.52% <ø> (ø)` | | Carriedforward from [e878df3](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [workflow-compiling-service](https://app.codecov.io/gh/apache/texera/pull/7577/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.31% <ø> (ø)` | | Carriedforward from [e878df3](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
*This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/texera/pull/7577?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(workflow-operator): cover the vectorizer branches of Sklearn code generation [texera]
Posted by "eugenegujing (via GitHub)" <gi...@apache.org>.
eugenegujing commented on PR #7577:
URL: https://github.com/apache/texera/pull/7577#issuecomment-5275753221
/request-review @aglinxinyuan
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(workflow-operator): cover the vectorizer branches of Sklearn code generation [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7577:
URL: https://github.com/apache/texera/pull/7577#issuecomment-5259299053
<!-- texera-benchmarks-comment -->
## ⚠️ Benchmark changes need a look
🟢 2 better · 🔴 4 worse · ⚪ 9 noise (<±5%) · 0 without baseline
> Compared against main `e878df3` 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](https://apache.github.io/texera/dev/bench/) · [Run](https://github.com/apache/texera/actions/runs/31539651554)
| | config | throughput | MB/s | latency | max Δ latest / 7d |
|---|---|---:|---:|---:|---:|
| 🟢 | bs=10 sw=10 sl=64 | 426 | 0.26 | 22,022/30,665/30,665 us | 🟢 -9.9% / 🔴 +91.8% |
| 🔴 | bs=100 sw=10 sl=64 | 910 | 0.556 | 106,504/147,079/147,079 us | 🔴 +16.9% / 🔴 +36.1% |
| 🔴 | bs=1000 sw=10 sl=64 | 1,078 | 0.658 | 922,596/1,024,055/1,024,055 us | 🔴 +6.4% / 🟢 -7.0% |
<details><summary>Baseline details</summary>
Latest main `e878df3` from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---:|---:|---:|---:|---:|
| bs=10 sw=10 sl=64 | throughput | 426 tuples/sec | 445 tuples/sec | 784.3 tuples/sec | -4.3% | -45.7% |
| bs=10 sw=10 sl=64 | MB/s | 0.26 MB/s | 0.271 MB/s | 0.479 MB/s | -4.1% | -45.7% |
| bs=10 sw=10 sl=64 | p50 | 22,022 us | 22,060 us | 12,590 us | -0.2% | +74.9% |
| bs=10 sw=10 sl=64 | p95 | 30,665 us | 34,028 us | 15,991 us | -9.9% | +91.8% |
| bs=10 sw=10 sl=64 | p99 | 30,665 us | 34,028 us | 18,694 us | -9.9% | +64.0% |
| bs=100 sw=10 sl=64 | throughput | 910 tuples/sec | 954 tuples/sec | 1,002 tuples/sec | -4.6% | -9.2% |
| bs=100 sw=10 sl=64 | MB/s | 0.556 MB/s | 0.582 MB/s | 0.612 MB/s | -4.5% | -9.1% |
| bs=100 sw=10 sl=64 | p50 | 106,504 us | 102,405 us | 101,285 us | +4.0% | +5.2% |
| bs=100 sw=10 sl=64 | p95 | 147,079 us | 125,840 us | 108,068 us | +16.9% | +36.1% |
| bs=100 sw=10 sl=64 | p99 | 147,079 us | 125,840 us | 118,235 us | +16.9% | +24.4% |
| bs=1000 sw=10 sl=64 | throughput | 1,078 tuples/sec | 1,091 tuples/sec | 1,030 tuples/sec | -1.2% | +4.7% |
| bs=1000 sw=10 sl=64 | MB/s | 0.658 MB/s | 0.666 MB/s | 0.629 MB/s | -1.2% | +4.7% |
| bs=1000 sw=10 sl=64 | p50 | 922,596 us | 916,616 us | 991,882 us | +0.7% | -7.0% |
| bs=1000 sw=10 sl=64 | p95 | 1,024,055 us | 962,907 us | 1,038,496 us | +6.4% | -1.4% |
| bs=1000 sw=10 sl=64 | p99 | 1,024,055 us | 962,907 us | 1,068,265 us | +6.4% | -4.1% |
</details>
<details><summary>Raw CSV</summary>
```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,470.03,200,128000,426,0.260,22021.69,30664.64,30664.64
1,100,10,64,20,2196.68,2000,1280000,910,0.556,106503.94,147079.27,147079.27
2,1000,10,64,20,18546.60,20000,12800000,1078,0.658,922595.51,1024054.70,1024054.70
```
</details>
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(workflow-operator): cover the vectorizer branches of Sklearn code generation [texera]
Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan merged PR #7577:
URL: https://github.com/apache/texera/pull/7577
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(workflow-operator): cover the vectorizer branches of Sklearn code generation [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7577:
URL: https://github.com/apache/texera/pull/7577#issuecomment-5259249896
<!-- texera-reviewer-suggestion -->
### Automated Reviewer Suggestions
Based on the `git blame` history of the changed files, we recommend the following reviewers:
- No candidates found from `git blame` history.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org