Skip to content

fix(workflow-operator): validate the spam operator's result attributes like its siblings - #8483

Open
PG1204 wants to merge 2 commits into
apache:mainfrom
PG1204:fix/hf-spam-operator-consistency
Open

fix(workflow-operator): validate the spam operator's result attributes like its siblings#8483
PG1204 wants to merge 2 commits into
apache:mainfrom
PG1204:fix/hf-spam-operator-consistency

Conversation

@PG1204

@PG1204 PG1204 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

HuggingFaceSpamSMSDetectionOpDesc.getOutputSchemas was the only one of the four legacy Hugging Face operators that neither validated its result-attribute names nor keyed the input schema by port id.

getOutputSchemas is called as the user configures an operator, so it needs an answer for "not filled in yet". HuggingFaceSentimentAnalysisOpDesc and HuggingFaceIrisLogisticRegressionOpDesc answer by returning null; this operator instead passed the unset name straight into Schema.add. It now returns null when either resultAttributeSpam or resultAttributeProbability is null or blank, matching its siblings.

The input schema is also now read as inputSchemas(operatorInfo.inputPorts.head.id) rather than inputSchemas.values.head, consistent with the sibling operators. With a single input port these are equivalent, so this is a consistency change rather than a behavioral fix.

Unifying the error contract across all four legacy operators, two return null, one throws, this one did neither — is a broader question and is not attempted here.

Any related issues?

Closes #8482

How was this PR tested?

347 tests pass across the huggingFace and operator-metadata suites, and scalafmtCheck is clean for main and test sources. Two tests were added to HuggingFaceSpamSMSDetectionOpDescSpec covering an unset and a blank name for both result attributes. Reverting the operator change and re-running makes exactly those two tests fail, confirming they exercise the fix; the existing happy-path test already keys the input schema by the declared input port, so it covers the lookup change.

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 Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

/request-review @Ma77Ball

this is a small fix unrelated to HuggingFaceInferenceOpDesc, this fix is for the HuggingFaceSpamSMSDetectionOpDesc op.
sentiment analysis and iris already return null from getOutputSchemas when a result attribute isn't set yet, and key the input schema by port id. This one did neither.

@Yicong-Huang Yicong-Huang added release/v1.3 back porting to release/v1.3 release/v1.2 back porting to release/v1.2 labels Sep 10, 2026
@github-actions
github-actions Bot requested review from mengw15 and xuang7 September 10, 2026 04:45
@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 Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.93%. Comparing base (0e549fa) to head (40b0228).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8483      +/-   ##
============================================
+ Coverage     93.69%   93.93%   +0.24%     
- Complexity     4825     4831       +6     
============================================
  Files          1209     1203       -6     
  Lines         49871    48990     -881     
  Branches       6099     5948     -151     
============================================
- Hits          46726    46019     -707     
+ Misses         1652     1505     -147     
+ Partials       1493     1466      -27     
Flag Coverage Δ *Carryforward flag
access-control-service 80.18% <ø> (ø)
agent-service 99.32% <ø> (ø) Carriedforward from 905c17d
amber 89.92% <100.00%> (+0.01%) ⬆️
computing-unit-managing-service 77.14% <ø> (ø)
config-service 87.12% <ø> (ø)
file-service 83.65% <ø> (ø)
frontend 96.82% <ø> (+0.65%) ⬆️ Carriedforward from 905c17d
notebook-migration-service 83.73% <ø> (ø)
pyamber 98.41% <ø> (-0.07%) ⬇️ Carriedforward from 905c17d
workflow-compiling-service 77.19% <ø> (ø)

*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 Sep 10, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main 0e549fa 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 538 0.328 17,058/27,859/27,859 us 🔴 +13.8% / 🔴 +72.7%
bs=100 sw=10 sl=64 1,178 0.719 81,986/108,291/108,291 us ⚪ within ±5% / 🟢 +20.2%
bs=1000 sw=10 sl=64 1,334 0.814 747,790/785,623/785,623 us ⚪ within ±5% / 🟢 +31.9%
Baseline details

Latest main 0e549fa from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 538 tuples/sec 608 tuples/sec 755.28 tuples/sec -11.5% -28.8%
bs=10 sw=10 sl=64 MB/s 0.328 MB/s 0.371 MB/s 0.461 MB/s -11.6% -28.8%
bs=10 sw=10 sl=64 p50 17,058 us 16,408 us 12,957 us +4.0% +31.7%
bs=10 sw=10 sl=64 p95 27,859 us 24,490 us 16,134 us +13.8% +72.7%
bs=10 sw=10 sl=64 p99 27,859 us 24,490 us 20,333 us +13.8% +37.0%
bs=100 sw=10 sl=64 throughput 1,178 tuples/sec 1,157 tuples/sec 980.1 tuples/sec +1.8% +20.2%
bs=100 sw=10 sl=64 MB/s 0.719 MB/s 0.706 MB/s 0.598 MB/s +1.8% +20.2%
bs=100 sw=10 sl=64 p50 81,986 us 83,557 us 101,894 us -1.9% -19.5%
bs=100 sw=10 sl=64 p95 108,291 us 109,138 us 108,718 us -0.8% -0.4%
bs=100 sw=10 sl=64 p99 108,291 us 109,138 us 122,482 us -0.8% -11.6%
bs=1000 sw=10 sl=64 throughput 1,334 tuples/sec 1,349 tuples/sec 1,011 tuples/sec -1.1% +31.9%
bs=1000 sw=10 sl=64 MB/s 0.814 MB/s 0.823 MB/s 0.617 MB/s -1.1% +31.9%
bs=1000 sw=10 sl=64 p50 747,790 us 743,892 us 996,422 us +0.5% -25.0%
bs=1000 sw=10 sl=64 p95 785,623 us 781,560 us 1,037,670 us +0.5% -24.3%
bs=1000 sw=10 sl=64 p99 785,623 us 781,560 us 1,072,152 us +0.5% -26.7%
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,371.64,200,128000,538,0.328,17057.96,27859.34,27859.34
1,100,10,64,20,1697.47,2000,1280000,1178,0.719,81985.84,108291.19,108291.19
2,1000,10,64,20,14993.35,20000,12800000,1334,0.814,747790.09,785623.05,785623.05

@Ma77Ball Ma77Ball 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! The added tests look correct, and there appear to be no blocking issues.
@PG1204, please fix the broken test cases below.

@mengw15 mengw15 removed release/v1.2 back porting to release/v1.2 release/v1.3 back porting to release/v1.3 labels Sep 11, 2026
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.

Make HuggingFaceSpamSMSDetectionOpDesc consistent with the other legacy Hugging Face operators

5 participants