Visitar URL original
fix(workflow-operator): require b64_json to be a string before building a data URL by PG1204 · Pull Request #8885 · apache/texera · GitHub
Skip to content

fix(workflow-operator): require b64_json to be a string before building a data URL - #8885

Open
PG1204 wants to merge 2 commits into
apache:mainfrom
PG1204:fix/hf-image-b64-validation
Open

PG1204 wants to merge 2 commits into
apache:mainfrom
PG1204:fix/hf-image-b64-validation

Conversation

@PG1204

@PG1204 PG1204 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

ImageTaskCodegen.parsePython's image-to-image branch built a data URL from the provider's b64_json without checking it, so a malformed but valid-JSON 200 put an unrenderable value in the result column, a null field became the literal data:image/png;base64,None, with nothing to indicate why the image was blank.

b64_json must now be a non-empty string; anything else falls through to json.dumps(body), which is what the branch already did for unrecognised shapes.

Scoped deliberately to b64_json, matching the issue. The sibling url lookups in the same branch have a comparable gap and are left for a separate issue.

Not addressed: a b64_json that is a string but not valid base64 still yields an unrenderable data URL. Detecting that means decoding the value on every row, and corrupt-but-well-formed base64 would pass regardless, so the browser's rejection is unchanged either way. Same reasoning as #8872.

Any related issues?

Closes #8870

How was this PR tested?

Written test-first: a test asserting the string guard was added to ImageTaskCodegenSpec and fails against the current parse. The suite is at 155 tests, PythonCodeRawInvalidTextSpec py-compiles all 117 operators, and scalafmtCheck and scalafix --check are clean.

The generated parser was also run directly: a null or numeric b64_json now returns the serialized body, and a valid base64 payload still produces the same data URL as before.

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

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

@Yicong-Huang Yicong-Huang added the release/v1.3 back porting to release/v1.3 label Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 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.

@github-actions
github-actions Bot requested a review from mengw15 October 6, 2026 23:30
@github-actions

github-actions Bot commented Oct 6, 2026

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 Not labeled automatically — none of the files this PR modifies exist on this branch (common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/huggingFace/codegen/ImageTaskCodegen.scala, common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/huggingFace/codegen/ImageTaskCodegenSpec.scala). The fix may target code that isn't on this release, or the files were moved/renamed after the branch was cut. Please check and add release/v1.2 by hand if this fix should be backported here — its release manager then has to approve before this PR can merge.

Auto-label run.

@codecov-commenter

codecov-commenter commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8885      +/-   ##
============================================
+ Coverage     92.60%   92.64%   +0.03%     
- Complexity     5046     5765     +719     
============================================
  Files          1252     1260       +8     
  Lines         53586    56972    +3386     
  Branches       6673     7193     +520     
============================================
+ Hits          49625    52782    +3157     
- Misses         2317     2474     +157     
- Partials       1644     1716      +72     
Flag Coverage Δ *Carryforward flag
access-control-service 79.63% <ø> (+2.25%) ⬆️
agent-service 99.16% <ø> (ø) Carriedforward from 4c982a7
amber 89.08% <ø> (+0.97%) ⬆️
computing-unit-managing-service 62.70% <ø> (+2.22%) ⬆️
config-service 90.51% <ø> (+3.13%) ⬆️
file-service 82.15% <ø> (+0.62%) ⬆️
frontend 96.59% <ø> (-0.01%) ⬇️ Carriedforward from 4c982a7
notebook-migration-service 85.13% <ø> (+1.40%) ⬆️
pyamber 98.52% <ø> (-0.01%) ⬇️ Carriedforward from 4c982a7
workflow-compiling-service 74.86% <ø> (+0.76%) ⬆️

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

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main be65bf8 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 523 0.319 18,781/27,688/27,688 us 🔴 -9.6% / 🔴 +88.7%
🟢 bs=100 sw=10 sl=64 1,172 0.715 84,330/106,370/106,370 us 🟢 -11.7% / 🟢 -11.6%
🔴 bs=1000 sw=10 sl=64 1,374 0.839 726,173/800,536/800,536 us 🔴 +6.2% / 🟢 -22.6%
Baseline details

Latest main be65bf8 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 523 tuples/sec 578 tuples/sec 866.99 tuples/sec -9.5% -39.7%
bs=10 sw=10 sl=64 MB/s 0.319 MB/s 0.353 MB/s 0.529 MB/s -9.6% -39.7%
bs=10 sw=10 sl=64 p50 18,781 us 17,355 us 11,989 us +8.2% +56.6%
bs=10 sw=10 sl=64 p95 27,688 us 26,979 us 14,672 us +2.6% +88.7%
bs=10 sw=10 sl=64 p99 27,688 us 26,979 us 17,906 us +2.6% +54.6%
bs=100 sw=10 sl=64 throughput 1,172 tuples/sec 1,156 tuples/sec 1,111 tuples/sec +1.4% +5.5%
bs=100 sw=10 sl=64 MB/s 0.715 MB/s 0.705 MB/s 0.678 MB/s +1.4% +5.4%
bs=100 sw=10 sl=64 p50 84,330 us 81,872 us 95,405 us +3.0% -11.6%
bs=100 sw=10 sl=64 p95 106,370 us 120,516 us 102,332 us -11.7% +3.9%
bs=100 sw=10 sl=64 p99 106,370 us 120,516 us 115,219 us -11.7% -7.7%
bs=1000 sw=10 sl=64 throughput 1,374 tuples/sec 1,406 tuples/sec 1,141 tuples/sec -2.3% +20.5%
bs=1000 sw=10 sl=64 MB/s 0.839 MB/s 0.858 MB/s 0.696 MB/s -2.2% +20.5%
bs=1000 sw=10 sl=64 p50 726,173 us 714,175 us 938,794 us +1.7% -22.6%
bs=1000 sw=10 sl=64 p95 800,536 us 753,665 us 984,521 us +6.2% -18.7%
bs=1000 sw=10 sl=64 p99 800,536 us 753,665 us 1,008,827 us +6.2% -20.6%
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,382.09,200,128000,523,0.319,18781.04,27687.54,27687.54
1,100,10,64,20,1706.92,2000,1280000,1172,0.715,84329.59,106370.18,106370.18
2,1000,10,64,20,14552.94,20000,12800000,1374,0.839,726173.04,800535.65,800535.65

@PG1204

PG1204 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

/request-review @xuang7

@github-actions
github-actions Bot requested a review from xuang7 October 9, 2026 18:03

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.3 back porting to release/v1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image-to-image parsing splices b64_json into a data URL unvalidated

3 participants