Skip to content

feat(workflow-operator): add Python UDF UI parameter injection model#5141

Open
carloea2 wants to merge 3 commits into
apache:mainfrom
carloea2:ui-parameter-backend-scala
Open

feat(workflow-operator): add Python UDF UI parameter injection model#5141
carloea2 wants to merge 3 commits into
apache:mainfrom
carloea2:ui-parameter-backend-scala

Conversation

@carloea2
Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

This PR adds the Scala backend foundation for Python UDF UI parameters.

It introduces:

Area Change
UI parameter model Adds UiUDFParameter, containing backend-compatible attribute metadata and an editable value.
Python UDF injector Adds PythonUdfUiParameterInjector, which validates UI parameters and injects a reserved hook method into supported Python UDF classes.
Safe string encoding Marks Attribute.getName() as encodable so UI parameter names are safely rendered through the Python template builder.
Test coverage Adds Scala tests for hook injection, validation, unsupported types, reserved method conflicts, and unchanged behavior when no UI parameters exist.

This PR is stacked after the merged frontend foundation PR #5043. It does not yet wire the injector into operator execution; that wiring is handled by later PRs in the stack.

Existing Python UDF workflow execution remains unchanged in this PR because PythonUDFOpDescV2, PythonUDFSourceOpDescV2, and DualInputPortsPythonUDFOpDescV2 are not modified here.

Any related issues, documentation, discussions?

Part of the Python UDF UI parameter feature split from feat/ui-parameter.

Related tracking issue / stack: #5044

Stack order:

  1. Frontend UI parameter building blocks: feat(frontend): add Python UDF UI parameter form support #5043
  2. Scala backend injection model: this PR
  3. Python runtime support
  4. End-to-end integration

How was this PR tested?

Commands run:

sbt "WorkflowOperator / Test / testOnly org.apache.texera.amber.operator.udf.python.PythonUdfUiParameterInjectorSpec"
sbt scalafmtAll
sbt scalafmtCheckAll "scalafixAll --check"

Results:

  • PythonUdfUiParameterInjectorSpec: 10 tests passed.
  • scalafmtAll: no file changes.
  • scalafmtCheckAll and scalafixAll --check: passed.

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

No

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 21, 2026

Codecov Report

❌ Patch coverage is 90.36145% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.44%. Comparing base (e4557ee) to head (4652aac).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ator/udf/python/PythonUdfUiParameterInjector.scala 90.00% 0 Missing and 8 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5141      +/-   ##
============================================
+ Coverage     43.34%   43.44%   +0.10%     
- Complexity     2213     2215       +2     
============================================
  Files          1049     1051       +2     
  Lines         40561    40644      +83     
  Branches       4322     4335      +13     
============================================
+ Hits          17581    17658      +77     
  Misses        21888    21888              
- Partials       1092     1098       +6     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø)
agent-service 33.72% <ø> (ø) Carriedforward from f386522
amber 44.06% <90.36%> (+0.25%) ⬆️
computing-unit-managing-service 0.00% <ø> (ø)
config-service 0.00% <ø> (ø)
file-service 32.18% <ø> (ø)
frontend 34.61% <ø> (ø) Carriedforward from f386522
python 90.50% <ø> (ø) Carriedforward from f386522
workflow-compiling-service 56.81% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants