Skip to content

feat(workflow-operator): name the missing ground-truth column in Sklearn Prediction's error - #8918

Merged
aglinxinyuan merged 4 commits into
apache:mainfrom
kz930:feat/sklearn-prediction-missing-ground-truth
Oct 24, 2026
Merged

aglinxinyuan merged 4 commits into
apache:mainfrom
kz930:feat/sklearn-prediction-missing-ground-truth

Conversation

@kz930

@kz930 kz930 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

When Sklearn Prediction's "Ground Truth Attribute Name to Ignore" names a column that is not in the data input, compilation failed with java.util.NoSuchElementException: None.get, which does not tell the user what is wrong. It now fails with "Ground Truth column '' is not in the input table", the same wording MachineLearningScorer uses for its columns.

Any related issues, documentation, discussions?

Closes #8864

How was this PR tested?

Updated the existing test in SklearnPredictionOpDescSpec to check the new message. sbt "WorkflowOperator/testOnly *SklearnPredictionOpDescSpec" passes, and so do scalafmt and scalafix.

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

Generated-by: Claude Code (Claude Opus 5.5)

🤖 Generated with Claude Code

…arn Prediction's error

A ground-truth name that is not in the data input failed compilation with
None.get. Say which column is missing instead, in the wording
MachineLearningScorer already uses.

Closes apache#8864

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

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.

@codecov-commenter

codecov-commenter commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.30%. Comparing base (7426431) to head (cd90841).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8918      +/-   ##
============================================
- Coverage     92.30%   92.30%   -0.01%     
  Complexity     5046     5046              
============================================
  Files          1260     1259       -1     
  Lines         53887    53824      -63     
  Branches       6711     6703       -8     
============================================
- Hits          49743    49682      -61     
+ Misses         2486     2485       -1     
+ Partials       1658     1657       -1     
Flag Coverage Δ *Carryforward flag
access-control-service 77.38% <ø> (ø)
agent-service 99.16% <ø> (ø) Carriedforward from 65a748a
amber 87.32% <100.00%> (+<0.01%) ⬆️
computing-unit-managing-service 60.48% <ø> (ø)
config-service 87.37% <ø> (ø)
file-service 82.00% <ø> (ø)
frontend 96.55% <ø> (ø) Carriedforward from 65a748a
notebook-migration-service 83.73% <ø> (ø)
pyamber 98.54% <ø> (+<0.01%) ⬆️ Carriedforward from 65a748a
workflow-compiling-service 72.43% <ø> (ø)

*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 Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main 7426431 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 404 0.246 24,045/33,080/33,080 us 🔴 -8.2% / 🔴 +126.5%
🔴 bs=100 sw=10 sl=64 931 0.568 106,771/122,720/122,720 us 🔴 +8.3% / 🔴 +22.5%
🔴 bs=1000 sw=10 sl=64 1,076 0.657 918,864/1,039,275/1,039,275 us 🔴 +8.0% / 🔴 +12.4%
Baseline details

Latest main 7426431 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 404 tuples/sec 439 tuples/sec 912.36 tuples/sec -8.0% -55.7%
bs=10 sw=10 sl=64 MB/s 0.246 MB/s 0.268 MB/s 0.557 MB/s -8.2% -55.8%
bs=10 sw=10 sl=64 p50 24,045 us 22,705 us 11,391 us +5.9% +111.1%
bs=10 sw=10 sl=64 p95 33,080 us 32,658 us 14,608 us +1.3% +126.5%
bs=10 sw=10 sl=64 p99 33,080 us 32,658 us 17,250 us +1.3% +91.8%
bs=100 sw=10 sl=64 throughput 931 tuples/sec 988 tuples/sec 1,161 tuples/sec -5.8% -19.8%
bs=100 sw=10 sl=64 MB/s 0.568 MB/s 0.603 MB/s 0.709 MB/s -5.8% -19.9%
bs=100 sw=10 sl=64 p50 106,771 us 101,358 us 91,471 us +5.3% +16.7%
bs=100 sw=10 sl=64 p95 122,720 us 113,323 us 100,192 us +8.3% +22.5%
bs=100 sw=10 sl=64 p99 122,720 us 113,323 us 119,565 us +8.3% +2.6%
bs=1000 sw=10 sl=64 throughput 1,076 tuples/sec 1,094 tuples/sec 1,226 tuples/sec -1.6% -12.2%
bs=1000 sw=10 sl=64 MB/s 0.657 MB/s 0.668 MB/s 0.748 MB/s -1.6% -12.2%
bs=1000 sw=10 sl=64 p50 918,864 us 920,734 us 887,282 us -0.2% +3.6%
bs=1000 sw=10 sl=64 p95 1,039,275 us 962,200 us 924,352 us +8.0% +12.4%
bs=1000 sw=10 sl=64 p99 1,039,275 us 962,200 us 951,858 us +8.0% +9.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,495.54,200,128000,404,0.246,24044.93,33080.15,33080.15
1,100,10,64,20,2147.34,2000,1280000,931,0.568,106770.55,122719.88,122719.88
2,1000,10,64,20,18591.45,20000,12800000,1076,0.657,918864.07,1039274.84,1039274.84

@carloea2 carloea2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One regression reproduced on this head with a passing exact-case control.

…klearn Prediction

Schema lookups ignore case, but the generated drop() does not, so a
case-only match passed validation and then raised KeyError at runtime.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@carloea2 carloea2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The case-only mismatch is now rejected before Python execution. All 17 SklearnPredictionOpDescSpec tests pass locally, including the exact-case control. The remaining macOS CI failure is in LoopIntegrationSpec; CI still needs to pass before merge.

@kz930

kz930 commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

The remaining failure is LoopIntegrationSpec on macOS, the engine race in #8937 that also fails on main. I'll re-run CI once #8938 merges.

@aglinxinyuan aglinxinyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Oct 24, 2026
Merged via the queue into apache:main with commit 5a44b5b Oct 24, 2026
33 checks passed
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 1, 2026
…way the engine does (apache#9035)

### What changes were proposed in this PR?

The engine looks a column up through `Schema`, which ignores case. So a
setting that names `Name` reads the column `name`, and the workflow runs
in Texera. The exported script indexed the pandas frame with the name as
written and stopped with a `KeyError`.

`StandaloneCodeGenerator` gains `columnAsStored`, which resolves a
setting's column name against the input schema and returns the table's
spelling. A name the schema does not hold comes back unchanged, so the
script still fails where the run would. Seven operators read their
column through it: Projection, Filter, Keyword Search, Regular
Expression, Substring Search, Dictionary Matcher and Unnest String.
Projection still names each output column by its alias, which falls back
to the name as the setting writes it. That matches `ProjectionOpExec`.

Type Casting is the exception. Its schema propagation and its executor
both match the column by its exact name, so in the engine a unit whose
column differs in case casts nothing and the column passes through
unchanged. The export now skips that unit too, instead of raising a
`KeyError`.

Operators that run as Python in the engine already compare names exactly
on both sides, so they are left alone.

### Any related issues, documentation, discussions?

Closes apache#9004. @carloea2 found the mismatch while reviewing apache#8918.

apache#8980 rewrites Filter's export and looks up the declared type by the
column's name. Whichever of the two merges second should look that type
up under the resolved name as well.

### How was this PR tested?

Each of the eight operators' `OpDescSpec` gains a test with a setting in
a different case from the table. It asserts that the generated code
reads the table's spelling. For Type Casting, the test also checks that
the engine's output schema leaves that column's type unchanged, and that
the export skips the unit. All of `WorkflowOperator/test` passes. Merged
with the other open export PRs, the verification suite still passes all
150 cases (3 ignored, as before).

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

Generated-by: Claude Code (Claude Opus 5.5)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exported Sklearn Prediction script fails when the configured ground truth column is missing from the input

4 participants