Skip to content

feat(udf): add Scala UiParameter injection support#4843

Draft
carloea2 wants to merge 59 commits intoapache:mainfrom
carloea2:backup/feat-ui-parameter-e50e29260
Draft

feat(udf): add Scala UiParameter injection support#4843
carloea2 wants to merge 59 commits intoapache:mainfrom
carloea2:backup/feat-ui-parameter-e50e29260

Conversation

@carloea2
Copy link
Copy Markdown
Contributor

@carloea2 carloea2 commented May 3, 2026

What changes were proposed in this PR?

This is PR 2 of the UiParameter split stack, based on PR 1.

This PR adds Scala-side infrastructure for injecting UI parameter values into Python UDF code, but does not activate it in execution yet.

It includes:

  • PythonUdfUiParameterInjector.
  • Validation for missing attributes, conflicting duplicate names, reserved hook collisions, and unsupported binary parameter types.
  • Scala tests for injection behavior.
  • String encoding support for parameter attribute names.

Execution remains unchanged in this PR: Python UDF descriptors still call OpExecWithCode(code, "python").

sequenceDiagram
    autonumber

    participant Desc as Scala UDF Descriptor
    participant Params as uiParameters Metadata
    participant Injector as PythonUdfUiParameterInjector
    participant Tests as Injector Specs
    participant Exec as Existing Execution Path

    Desc->>Params: Holds inert uiParameters
    Tests->>Injector: Validate injection behavior
    Injector->>Injector: Validate names, types, reserved hook
    Injector->>Injector: Generate hook code when called
    Desc->>Exec: Still executes original code
    Note over Desc,Exec: Injector exists but is not wired into runtime yet
Loading

@github-actions github-actions Bot added engine dependencies Pull requests that update a dependency file python frontend Changes related to the frontend GUI common labels May 3, 2026
@carloea2 carloea2 changed the title Backup/feat UI parameter e50e29260 feat(udf): add Scala UiParameter injection support May 3, 2026
@carloea2
Copy link
Copy Markdown
Contributor Author

carloea2 commented May 3, 2026

@kunwp1 please confirm if this layout is ok for you to review. Then I can test it locally and request your review once it is ready.

@chenlica
Copy link
Copy Markdown
Contributor

chenlica commented May 3, 2026

It has 25 files. Can we divide it?

Check a related discussion about how to manage PRs #4590 .

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 3, 2026

Codecov Report

❌ Patch coverage is 83.43949% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.20%. Comparing base (1c3ec67) to head (cbafe34).

Files with missing lines Patch % Lines
amber/src/main/python/pytexera/udf/udf_operator.py 89.18% 8 Missing ⚠️
...ator/udf/python/PythonUdfUiParameterInjector.scala 89.39% 0 Missing and 7 partials ⚠️
...or/udf/python/source/PythonUDFSourceOpDescV2.scala 0.00% 5 Missing ⚠️
...r/udf/python/DualInputPortsPythonUDFOpDescV2.scala 0.00% 3 Missing ⚠️
.../amber/operator/udf/python/PythonUDFOpDescV2.scala 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4843      +/-   ##
============================================
+ Coverage     43.02%   43.20%   +0.17%     
- Complexity     2029     2032       +3     
============================================
  Files           957      959       +2     
  Lines         34077    34221     +144     
  Branches       3753     3764      +11     
============================================
+ Hits          14663    14785     +122     
- Misses        18637    18651      +14     
- Partials        777      785       +8     
Flag Coverage Δ
access-control-service 28.12% <ø> (ø)
amber 41.15% <77.50%> (+0.19%) ⬆️
computing-unit-managing-service 0.00% <ø> (ø)
config-service 0.00% <ø> (ø)
file-service 33.24% <ø> (ø)
python 84.90% <89.61%> (+0.06%) ⬆️
workflow-compiling-service 47.72% <ø> (ø)

Flags with carried forward coverage won't be shown. 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.

@carloea2
Copy link
Copy Markdown
Contributor Author

carloea2 commented May 3, 2026

This PR is not going to be merged before the first, so when first is merged it will be reduced. In fact I will close this 2nd and 3rd after approval in the split strategy. And raise the PRs sequentially.

I just want to know if @kunwp1 like this split.

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

Labels

common dependencies Pull requests that update a dependency file engine frontend Changes related to the frontend GUI python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants