Skip to content

fix(workflow-operator): one validation contract for the four legacy Hugging Face operators - #9209

Open
PG1204 wants to merge 1 commit into
apache:mainfrom
PG1204:fix/hf-legacy-schema-validation
Open

PG1204 wants to merge 1 commit into
apache:mainfrom
PG1204:fix/hf-legacy-schema-validation

Conversation

@PG1204

@PG1204 PG1204 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

The four legacy Hugging Face operators (Spam Detection, Sentiment Analysis, Text Summarization and Iris Logistic Regression) now validate their configuration the same way in getOutputSchemas, through one shared helper, HuggingFaceSchemaValidation:

  • They throw and never return null, as @Ma77Ball recommended on Align schema validation across the four legacy Hugging Face operators #8728. Spam and Sentiment used to return null for an empty result column. The compiler runs getOutputSchemas inside a Try and stores a thrown error on the output port. A returned null counted as success, then failed one line later in PhysicalOp.propagateSchema (schemaMapping.foldLeft) with a NullPointerException, so the user saw an NPE instead of a message. Summarization and Iris already threw, but with generic messages. All four now name the field, e.g. Spam result attribute cannot be empty.
  • Input columns are checked at build time. The column each operator reads (Attribute for the three text operators, the two petal columns for Iris) must be set and present in the input table. The match is exact-case: Schema lookups ignore case, but the generated Python does not. The error lists the available columns, as fix(workflow-operator): report a clear error when a configured HF image/audio column is missing #7299's does. Iris's petal columns must also be numeric (integer, long or double), matching its existing frontend type rule.
  • Summarization reads its input schema by port id (inputSchemas(operatorInfo.inputPorts.head.id)), as the other three do, instead of inputSchemas.values.head.

Two corrections to the text of #8728. Iris reads two input columns (petal length and petal width), not four. And #7299's check runs in the generated Python at run time, so it is the precedent for the message wording, not for where the check lives.

Any related issues?

Closes #8728

How was this PR tested?

The tests were written first. 22 new or rewritten tests across the four specs failed against main for the expected reasons; Spam's and Sentiment's propagation tests failed with the NullPointerException itself. All 22 pass with the change, and reverting the four operators makes exactly those 22 fail again. The six tests that asserted null now assert the thrown message. The Spam and Iris happy-path inputs gained the columns those operators read, and their assertions are unchanged.

The full WorkflowOperator suite passes: 2756 tests, 0 failures, with 1 cancelled and 2 pending, none of them in the Hugging Face suites. The generated Python of all 117 operators compiles, and scalafmt and scalafix are clean.

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

Yes, this PR was co-authored with Claude in compliance with ASF policy.

@PG1204

PG1204 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

/request-review @Ma77Ball

@Yicong-Huang Yicong-Huang added the release/v1.3 back porting to release/v1.3 label Oct 29, 2026
@Yicong-Huang Yicong-Huang added the release/v1.2 back porting to release/v1.2 label Oct 29, 2026
@github-actions
github-actions Bot requested review from mengw15 and xuang7 October 29, 2026 06:01
@github-actions

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. A release/* label nominates a backport target; the branch's release manager approving this PR is what sends the fix there. The required Backport Approvals check stays red until every label below is approved, so each manager either approves or removes their own label — which is why the labels left on a merged PR are exactly the branches it reached.

Release branch Analysis
✅ release/v1.3 Change detected on this branch — label added; this fix is queued to backport here. @mengw15 decides: approving sends the fix here, removing this label declines it. The merge waits on one or the other. Review requested.
✅ release/v1.2 Change detected on this branch — label added; this fix is queued to backport here. @xuang7 decides: approving sends the fix here, removing this label declines it. The merge waits on one or the other. Review requested.

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: @kz930
    You can notify them by mentioning @kz930 in a comment.

@codecov-commenter

codecov-commenter commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.06%. Comparing base (f673554) to head (9a959b4).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9209   +/-   ##
=========================================
  Coverage     92.05%   92.06%           
+ Complexity     5041     5029   -12     
=========================================
  Files          1286     1287    +1     
  Lines         55911    55928   +17     
  Branches       7137     7135    -2     
=========================================
+ Hits          51469    51488   +19     
- Misses         2692     2693    +1     
+ Partials       1750     1747    -3     
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø)
agent-service 99.16% <ø> (ø) Carriedforward from f673554
amber 86.59% <100.00%> (+0.02%) ⬆️
computing-unit-managing-service 64.02% <ø> (ø)
config-service 87.61% <ø> (ø)
file-service 82.29% <ø> (ø)
frontend 96.48% <ø> (ø) Carriedforward from f673554
notebook-migration-service 83.77% <ø> (ø)
pyamber 98.54% <ø> (ø) Carriedforward from f673554
workflow-compiling-service 74.25% <ø> (ø)

*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

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main f673554 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 670 0.409 14,422/20,065/20,065 us 🔴 -15.4% / 🔴 +43.0%
🔴 bs=100 sw=10 sl=64 1,646 1.004 59,313/67,701/67,701 us 🟢 -14.0% / 🟢 -39.2%
⚪ bs=1000 sw=10 sl=64 1,966 1.2 498,797/593,621/593,621 us ⚪ within ±5% / 🟢 +58.7%
Baseline details

Latest main f673554 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 670 tuples/sec 792 tuples/sec 905.73 tuples/sec -15.4% -26.0%
bs=10 sw=10 sl=64 MB/s 0.409 MB/s 0.483 MB/s 0.553 MB/s -15.3% -26.0%
bs=10 sw=10 sl=64 p50 14,422 us 12,600 us 11,331 us +14.5% +27.3%
bs=10 sw=10 sl=64 p95 20,065 us 18,652 us 14,032 us +7.6% +43.0%
bs=10 sw=10 sl=64 p99 20,065 us 18,652 us 17,338 us +7.6% +15.7%
bs=100 sw=10 sl=64 throughput 1,646 tuples/sec 1,754 tuples/sec 1,205 tuples/sec -6.2% +36.6%
bs=100 sw=10 sl=64 MB/s 1.004 MB/s 1.07 MB/s 0.735 MB/s -6.2% +36.5%
bs=100 sw=10 sl=64 p50 59,313 us 55,455 us 89,237 us +7.0% -33.5%
bs=100 sw=10 sl=64 p95 67,701 us 78,685 us 96,280 us -14.0% -29.7%
bs=100 sw=10 sl=64 p99 67,701 us 78,685 us 111,344 us -14.0% -39.2%
bs=1000 sw=10 sl=64 throughput 1,966 tuples/sec 2,003 tuples/sec 1,239 tuples/sec -1.8% +58.7%
bs=1000 sw=10 sl=64 MB/s 1.2 MB/s 1.223 MB/s 0.756 MB/s -1.9% +58.7%
bs=1000 sw=10 sl=64 p50 498,797 us 493,785 us 877,826 us +1.0% -43.2%
bs=1000 sw=10 sl=64 p95 593,621 us 586,484 us 919,412 us +1.2% -35.4%
bs=1000 sw=10 sl=64 p99 593,621 us 586,484 us 963,000 us +1.2% -38.4%
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,298.44,200,128000,670,0.409,14422.42,20064.93,20064.93
1,100,10,64,20,1215.28,2000,1280000,1646,1.004,59312.91,67701.35,67701.35
2,1000,10,64,20,10172.52,20000,12800000,1966,1.200,498797.08,593621.49,593621.49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common fix release/v1.2 back porting to release/v1.2 release/v1.3 back porting to release/v1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align schema validation across the four legacy Hugging Face operators

3 participants