Skip to content

feat(workflow-operator): add UI parameters for R UDFs - #9279

Merged
kunwp1 merged 11 commits into
apache:mainfrom
carloea2:feat/r-ui-parameters
Nov 4, 2026
Merged

kunwp1 merged 11 commits into
apache:mainfrom
carloea2:feat/r-ui-parameters

Conversation

@carloea2

@carloea2 carloea2 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Add typed UI parameters and model/dataset selections to R UDF and 1-out R UDF, for both tuple and table APIs. Users declare parameters in R, edit their values in the properties panel, and receive native R values at execution.

count <- UiParameter("count", AttributeType$INT)$value
function(table, port) { head(table, count) }

Share the neutral parameter model, alias/resource manifest, metadata validation, resource bindings, and contract fixtures with Python. Keep Python/R syntax parsers and runtime adapters separate. The R compiler emits SDK v1 calls; native conversion and isolated operator state live in texera-rudf. Resource selections resolve to mount directories at execution time. An old installed plugin produces an explicit upgrade error.

One operator-to-language helper drives the editor and parameter synchronization. Parser entry points require an explicit language; R raw strings support both quote forms.

Main-repository net LOC: +472 implementation/type data, +969 tests/fixtures, +99 documentation. The Python parser is moved into its language adapter.

Before: existing R properties After: typed R parameters
R properties before UI parameter support R properties with editable integer, string, and boolean values

Screenshots use the same local test workflow. The after view runs this PR's frontend with R schemas exported by its Scala metadata generator; a metadata-only proxy reuses the local backend for authentication and persistence. Capture steps and provenance.

Any related issues, documentation, discussions?

Closes #9277.

Requires companion runtime PR: Texera/texera-rudf#2 (approved by kunwp1; prepared as texera-rudf 0.2.0, SDK v1; not yet published).

Architecture and ownership: UI parameter architecture.

How was this PR tested?

  • Current revision: CI run for 615bb576be, triggered after the frontend review fixes. The preceding matrix passed all required jobs.
  • Manual UI: entered R declarations, edited integer/string/boolean values, reloaded, and verified the values persisted and inferred names/types were disabled after reopening the editor.
  • Full local Windows frontend suite: 7,098 passed, one pre-existing skip, with coverage and two workers (Node 24.14.1).
  • 301 targeted frontend tests passed, covering raw-string boundaries, parameter synchronization, the workflow graph, and editor language selection for Python/R/Java/unknown operators.
  • CI follow-ups control timers in existing admin-table sorting tests, scope the workflow-lock timeout test to Angular's fake clock, and stub rendering only in report image-inlining tests. Separate PNG tests retain actual rendering. All original assertions remain; the full frontend suite passes locally.
  • 132 Scala tests passed; 42 contract checks additionally passed in a Turkish-locale test JVM.
  • 268 Python/plugin/integration tests passed with actual R, rpy2, R Arrow, and PyArrow. All four R source/processing and tuple/table modes now exercise a padded LONG boundary and a minute-precision timestamp through Arrow. The 54 shared value cases cover signs/zero padding, hex rejection, hour/minute timestamps, timezone offsets, and invalid clock fields. A forced-clamping regression also verifies the companion SDK overflow guard.
  • Compile/Test scalafix and scalafmt checks, targeted frontend lint/format checks, Python Ruff, and isolated Docker manifest-packaging smoke check passed. A complete production image was not built.
  • Last completed benchmark run at 4062071473: six improved metrics, eight within 5%, and one worse metric (10-tuple median latency +6.2%). Throughput for that case is within 5%; its tail latency improved. The benchmark runs a direct identity Python UDF and bypasses the changed parameter compiler/SDK path. No cause has been established; the advisory remains visible for review.
Commands and local validation limits

Frontend, from frontend/:

node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng.js test --watch=false --progress=false --include='src/app/workspace/service/code-editor/*ui*parameters*.spec.ts' --include='src/app/workspace/component/code-editor-dialog/code-editor.component.spec.ts' --include='src/app/workspace/service/workflow-graph/model/workflow-graph.spec.ts' --runner-config=/path/to/temporary/vitest-local.config.mts

Full local Windows frontend run used the same Vitest configuration with only test.maxWorkers = 2 in a temporary external runner config, plus NG_BUILD_MAX_WORKERS=2 and RAYON_NUM_THREADS=2 to fit the shared workstation:

node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng.js test --watch=false --progress=false --coverage --coverage-reporters=lcovonly --runner-config=/path/to/temporary/vitest-local.config.mts

Scala task invocation from the repository root (the local Windows run used Java 17 with @.jvmopts and sbt-launch.jar):

sbt 'set DAO / Test / sources := (DAO / Test / sources).value.filterNot(_.getName == "UserWarehouseSpec.scala")' \
  'WorkflowOperator/scalafix --check' 'WorkflowOperator/Test/scalafix --check' \
  'WorkflowOperator/scalafmtCheck' 'WorkflowOperator/Test/scalafmtCheck' \
  'WorkflowOperator/testOnly *UiUdfParameterContractSpec *UiUDFParameterSpec *PythonUdfUiParameter*Spec *RUdfUiParameterInjectorSpec *RUDFOpDescSpec *RUDFSourceOpDescSpec *PythonUDFOpDescV2Spec *DualInputPortsPythonUDFOpDescV2Spec *PythonUDFSourceOpDescV2Spec' \
  'WorkflowOperator/Test/runMain org.apache.texera.amber.operator.udf.UiParameterIntegrationFixtures common/workflow-operator/target/ui-parameter-fixtures.json'

The local database is behind the DAO schema, so the unrelated UserWarehouseSpec.scala was excluded from DAO test-source compilation for this targeted run. No build configuration was changed. For locale checks, the contract suite was rerun with WorkflowOperator / Test / fork := true and JVM options -Duser.language=tr -Duser.country=TR.

Actual R integration invocation in the prepared Linux environment (Python 3.12, R 4.5.3, R Arrow 25.0.1, PyArrow 23.0.1, and the companion plugin installed):

# Activate the prepared R/Python environment and run from the Apache checkout's amber/ directory.
# R_PLUGIN_DIR points to the companion plugin checkout; CONDA_PREFIX is the prepared environment.
LD_LIBRARY_PATH="$CONDA_PREFIX/lib" PYTHONPATH="$R_PLUGIN_DIR:$PYTHONPATH" TEXERA_R_INTEGRATION=1 \
python -m pytest src/test/python/core/architecture/managers/test_executor_manager.py src/test/python/pytexera/udf/test_udf_operator.py src/test/python/pytexera/udf/test_ui_parameter_contract.py "$R_PLUGIN_DIR/tests" -q

TEXERA_R_INTEGRATION=1 fails explicitly if the actual plugin or compiler fixtures are missing. These are targeted suites, not a full repository run.

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

Generated-by: OpenAI Codex 0.166.0-alpha.5.1

Share the wire model, metadata/type contract, resource binding, and contract fixtures across Python and R. Keep language parsers and runtime adapters separate, with R execution owned by the companion plugin.

Requires Texera/texera-rudf commit 5c92be27b19320f27ebbc82885bcca9479af374b (UI parameter SDK v1).

Validated: 431 frontend, 130 Scala, 39 additional Turkish-locale checks, and 211 Python/R integration tests; all four real R/Arrow executor modes passed.

Closes apache#9277
Remove duplicate metadata checks, simplify compiler integration fixtures, compact case tables, and shorten reproduction documentation. Preserve the shared contracts and all four real R/Arrow execution paths.

Validated: 431 frontend, 132 Scala, and 211 Python/R integration tests passed.

Related to apache#9277.
Use a typed alias manifest, centralize frontend edit validation, simplify R literal decoding, and capture lazy resource bindings without a forwarding class. Keep separate language parsers and the SDK v1 contract.

Validated: 438 frontend, 132 Scala, 42 Turkish-locale contract checks, and 211 Python/R integration tests; all four actual R/Arrow executor modes passed.

Related to apache#9277.
@github-actions github-actions Bot added feature pyamber frontend Changes related to the frontend GUI docs Changes related to documentations infra common labels Nov 4, 2026
@carloea2

carloea2 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/request-review @kunwp1

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Committers with relevant context: @parshimers
    You can request their reviews formally with /request-review @parshimers.

  • Contributors with relevant context: @aicam, @aglinxinyuan, @sshiv012
    You can notify them by mentioning @aicam, @aglinxinyuan, @sshiv012 in a comment.

@codecov-commenter

codecov-commenter commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.48819% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.17%. Comparing base (86fbe56) to head (615bb57).
⚠️ Report is 8 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../service/code-editor/r-ui-udf-parameters-parser.ts 93.96% 0 Missing and 7 partials ⚠️
...ice/code-editor/python-ui-udf-parameters-parser.ts 95.74% 1 Missing and 5 partials ⚠️
...era/amber/operator/udf/UdfUiParameterSupport.scala 81.81% 0 Missing and 4 partials ⚠️
...ra/amber/operator/udf/UiUdfParameterContract.scala 87.50% 1 Missing and 1 partial ⚠️
...vice/code-editor/ui-udf-parameters-sync.service.ts 90.00% 0 Missing and 1 partial ⚠️
...ace/service/workflow-graph/model/workflow-graph.ts 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9279      +/-   ##
============================================
- Coverage     92.17%   92.17%   -0.01%     
+ Complexity     4987     4978       -9     
============================================
  Files          1284     1274      -10     
  Lines         55605    55721     +116     
  Branches       7120     7176      +56     
============================================
+ Hits          51256    51360     +104     
+ Misses         2591     2585       -6     
- Partials       1758     1776      +18     
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø)
agent-service 99.54% <ø> (ø) Carriedforward from 4062071
amber 86.81% <91.42%> (-0.03%) ⬇️
computing-unit-managing-service 64.02% <ø> (ø)
config-service 87.61% <ø> (ø)
file-service 82.29% <ø> (ø)
frontend 96.46% <95.14%> (-0.02%) ⬇️
notebook-migration-service 83.77% <ø> (ø)
pyamber 98.54% <100.00%> (+<0.01%) ⬆️
workflow-compiling-service 77.95% <ø> (ø)

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

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main 86fbe56 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 385 0.235 25,150/32,815/32,815 us 🔴 +21.6% / 🔴 +150.0%
🔴 bs=100 sw=10 sl=64 814 0.497 118,169/164,265/164,265 us 🔴 +17.3% / 🔴 +80.3%
⚪ bs=1000 sw=10 sl=64 963 0.588 1,029,226/1,165,757/1,165,757 us ⚪ within ±5% / 🔴 +31.1%
Baseline details

Latest main 86fbe56 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 385 tuples/sec 440 tuples/sec 931.98 tuples/sec -12.5% -58.7%
bs=10 sw=10 sl=64 MB/s 0.235 MB/s 0.268 MB/s 0.569 MB/s -12.3% -58.7%
bs=10 sw=10 sl=64 p50 25,150 us 20,686 us 10,818 us +21.6% +132.5%
bs=10 sw=10 sl=64 p95 32,815 us 37,308 us 13,127 us -12.0% +150.0%
bs=10 sw=10 sl=64 p99 32,815 us 37,308 us 16,504 us -12.0% +98.8%
bs=100 sw=10 sl=64 throughput 814 tuples/sec 872 tuples/sec 1,210 tuples/sec -6.7% -32.7%
bs=100 sw=10 sl=64 MB/s 0.497 MB/s 0.532 MB/s 0.739 MB/s -6.6% -32.7%
bs=100 sw=10 sl=64 p50 118,169 us 113,461 us 85,326 us +4.1% +38.5%
bs=100 sw=10 sl=64 p95 164,265 us 140,090 us 91,092 us +17.3% +80.3%
bs=100 sw=10 sl=64 p99 164,265 us 140,090 us 102,379 us +17.3% +60.4%
bs=1000 sw=10 sl=64 throughput 963 tuples/sec 958 tuples/sec 1,240 tuples/sec +0.5% -22.3%
bs=1000 sw=10 sl=64 MB/s 0.588 MB/s 0.585 MB/s 0.757 MB/s +0.5% -22.3%
bs=1000 sw=10 sl=64 p50 1,029,226 us 1,040,852 us 840,622 us -1.1% +22.4%
bs=1000 sw=10 sl=64 p95 1,165,757 us 1,142,645 us 889,172 us +2.0% +31.1%
bs=1000 sw=10 sl=64 p99 1,165,757 us 1,142,645 us 931,615 us +2.0% +25.1%
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,519.24,200,128000,385,0.235,25149.50,32815.05,32815.05
1,100,10,64,20,2458.47,2000,1280000,814,0.497,118168.54,164264.80,164264.80
2,1000,10,64,20,20768.19,20000,12800000,963,0.588,1029225.77,1165756.59,1165756.59

@kunwp1

kunwp1 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@carloea2 It's really quick! Let me know if this PR is ready for the review. Thanks!

@carloea2
carloea2 marked this pull request as ready for review November 4, 2026 03:33
@carloea2

carloea2 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@kunwp1 Yes, this is ready for review. The description includes before/after UI screenshots and validation commands.

Your SDK comments are fixed in Texera/texera-rudf#2 (4ba7354), with shared regression cases here. All 268 native R/Arrow checks pass across all four R executor modes, and the latest required CI matrix passed at 4062071.

Could you review both PRs together? The companion plugin must be released before enabling parameterized R scripts in Apache Texera.

The small-batch benchmark advisory remains linked in the description; I have not established its cause.

@kunwp1 kunwp1 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.

The main changes look good to me! I have a few comments and I'll have one more pass after addressing the comments.

@carloea2

carloea2 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/request-review @kunwp1

@github-actions
github-actions Bot requested a review from kunwp1 November 4, 2026 17:45

@kunwp1 kunwp1 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!

Copilot AI 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.

🔵 Needs a closer look

Approval should wait because end-to-end validation depends on the unpublished texera-rudf 0.2.0 companion package and runtime integration across Scala, frontend, Amber, and deployment packaging.

No open issues 🎉

What changed in this PR

Adds typed UI parameters to R UDF and 1-out R UDF operators across tuple and table APIs, with shared Python/R metadata contracts, resource binding, frontend synchronization, SDK v1 integration, and documentation.

Changes:

  • Added R parameter parsing, insertion, synchronization, and editor language detection.
  • Added shared frontend, Scala, and Python/R parameter contracts, validation, resource binding, and fixtures.
  • Added R SDK capability checks, Docker packaging, documentation, and regression coverage.
  • The R parser has one moderate finding: top-level loop bindings can overwrite an inserted parameter with the same name.
File Description
frontend/​src/​app/​workspace/​service/​workflow-graph/​model/​workflow-graph.ts Adds shared Python/R UDF language detection.
frontend/​src/​app/​workspace/​service/​report-generation/​report-generation.service.spec.ts Isolates image-rendering behavior in report tests.
frontend/​src/​app/​workspace/​service/​code-editor/​ui-udf-parameters-sync.service.ts Synchronizes UI parameters for Python and R code.
frontend/​src/​app/​workspace/​service/​code-editor/​ui-udf-parameters-sync.service.spec.ts Tests Python/R parameter synchronization and insertion.
frontend/​src/​app/​workspace/​service/​code-editor/​ui-udf-parameters-parser.service.ts Dispatches parsing and insertion by explicit language.
frontend/​src/​app/​workspace/​service/​code-editor/​ui-udf-parameters-parser.service.spec.ts Updates parser tests for explicit language selection.
frontend/​src/​app/​workspace/​service/​code-editor/​ui-udf-parameters-contract.spec.ts Validates shared declaration metadata across languages.
frontend/​src/​app/​workspace/​service/​code-editor/​ui-udf-parameter.ts Defines the shared frontend parameter model and manifest policy.
frontend/​src/​app/​workspace/​service/​code-editor/​r-ui-udf-parameters-parser.ts Parses and inserts R UI parameter declarations; contains the noted loop-binding collision finding.
frontend/​src/​app/​workspace/​service/​code-editor/​r-ui-udf-parameters-parser.spec.ts Tests R syntax, strings, resources, and insertion behavior.
frontend/​src/​app/​workspace/​service/​code-editor/​python-ui-udf-parameters-parser.ts Moves Python parsing into its language adapter.
frontend/​src/​app/​workspace/​component/​ui-udf-parameters/​ui-udf-parameters.component.ts Uses manifest-driven parameter types in the editor.
frontend/​src/​app/​workspace/​component/​result-panel/​ai-fix/​ai-workflow-fixer.service.spec.ts Stabilizes workflow-lock timeout testing.
frontend/​src/​app/​workspace/​component/​code-editor-dialog/​code-editor.component.ts Uses shared language detection for editor configuration.
frontend/​src/​app/​dashboard/​component/​admin/​user/​admin-user.component.spec.ts Stabilizes admin table sorting tests with scoped timers.
docs/​reference/​operators/​user-defined-functions/​r/​r-udf.md Documents R UDF parameters and resource declarations.
docs/​reference/​operators/​user-defined-functions/​r/​1-out-r-udf.md Documents source R UDF parameters and resources.
docs/​reference/​operators/​user-defined-functions/​r/​_index.md Adds R UI parameter usage and supported types.
docs/​contribution-guidelines/​ui-parameter-architecture.md Describes shared parameter architecture and integration boundaries.
docs/​contribution-guidelines/​_index.md Links to the UI parameter architecture guide.
common/​workflow-operator/​src/​test/​scala/​org/​apache/​texera/​amber/​operator/​udf/​UiUdfParameterContractSpec.scala Tests shared metadata validation for Python and R.
common/​workflow-operator/​src/​test/​scala/​org/​apache/​texera/​amber/​operator/​udf/​UiParameterIntegrationFixtures.scala Generates compiler and runtime integration fixtures.
common/​workflow-operator/​src/​test/​scala/​org/​apache/​texera/​amber/​operator/​udf/​r/​RUdfUiParameterInjectorSpec.scala Tests R parameter injection and SDK markers.
common/​workflow-operator/​src/​test/​scala/​org/​apache/​texera/​amber/​operator/​udf/​python/​UiUDFParameterSpec.scala Updates shared parameter model tests.
common/​workflow-operator/​src/​test/​scala/​org/​apache/​texera/​amber/​operator/​udf/​python/​source/​PythonUDFSourceOpDescV2Spec.scala Updates relocated parameter-model imports.
common/​workflow-operator/​src/​test/​scala/​org/​apache/​texera/​amber/​operator/​udf/​python/​PythonUdfUiParameterSupportSpec.scala Tests Python/R resource binding behavior.
common/​workflow-operator/​src/​test/​scala/​org/​apache/​texera/​amber/​operator/​udf/​python/​PythonUdfUiParameterInjectorSpec.scala Updates Python injector tests for shared metadata.
common/​workflow-operator/​src/​test/​scala/​org/​apache/​texera/​amber/​operator/​udf/​python/​PythonUDFOpDescV2Spec.scala Updates Python operator descriptor tests.
common/​workflow-operator/​src/​test/​scala/​org/​apache/​texera/​amber/​operator/​udf/​python/​DualInputPortsPythonUDFOpDescV2Spec.scala Updates dual-input Python descriptor tests.
common/​workflow-operator/​src/​test/​resources/​udf/​ui-parameter-contract.json Defines shared declaration, value, and metadata cases.
common/​workflow-operator/​src/​main/​scala/​org/​apache/​texera/​amber/​operator/​udf/​UiUdfParameterContract.scala Loads and validates the shared Scala parameter contract.
common/​workflow-operator/​src/​main/​scala/​org/​apache/​texera/​amber/​operator/​udf/​UiUDFParameter.scala Makes the serialized parameter model language-neutral.
common/​workflow-operator/​src/​main/​scala/​org/​apache/​texera/​amber/​operator/​udf/​UdfUiParameterSupport.scala Provides shared resource binding and injection support.
common/​workflow-operator/​src/​main/​scala/​org/​apache/​texera/​amber/​operator/​udf/​r/​RUdfUiParameterSupport.scala Connects R descriptors to shared support.
common/​workflow-operator/​src/​main/​scala/​org/​apache/​texera/​amber/​operator/​udf/​r/​RUdfUiParameterInjector.scala Emits SDK v1 R parameter wrapper calls.
common/​workflow-operator/​src/​main/​scala/​org/​apache/​texera/​amber/​operator/​udf/​r/​RUDFSourceOpDesc.scala Enables parameters for source R UDFs.
common/​workflow-operator/​src/​main/​scala/​org/​apache/​texera/​amber/​operator/​udf/​r/​RUDFOpDesc.scala Enables parameters for processing R UDFs.
common/​workflow-operator/​src/​main/​scala/​org/​apache/​texera/​amber/​operator/​udf/​python/​PythonUdfUiParameterSupport.scala Adapts Python descriptors to shared support.
common/​workflow-operator/​src/​main/​scala/​org/​apache/​texera/​amber/​operator/​udf/​python/​PythonUdfUiParameterInjector.scala Uses shared validation while retaining Python encoding.
common/​workflow-operator/​src/​main/​resources/​udf/​ui-parameter-types.json Defines shared supported types and resources.
bin/​dockerfiles/​texera-web-application.dockerfile Packages the shared frontend parameter manifest.
amber/​src/​test/​python/​pytexera/​udf/​test_ui_parameter_contract.py Tests Python and R contract/runtime integration.
amber/​src/​test/​python/​core/​architecture/​managers/​test_executor_manager.py Tests R SDK capability handling.
amber/​src/​main/​python/​core/​architecture/​managers/​executor_manager.py Rejects parameterized R code on old plugins.

Review effort: Lite

@kunwp1
kunwp1 added this pull request to the merge queue Nov 4, 2026
Merged via the queue into apache:main with commit a786d47 Nov 4, 2026
50 checks passed
@carloea2

carloea2 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Confirmed the loop-binding concern with actual R 4.5.3 and the R SDK: the supplied parameter value 42 became 3 after the script-level loop. The fix is in #9314, closing #9313. It reserves script-level iterators while preserving function-local bindings. The full frontend suite passes: 7,109 tests, one existing skip.

The companion runtime PR Texera/texera-rudf#2 merged before this PR. Its upstream Git installation now provides version 0.2.0; the SDK file matches the source used in native validation. The documented install is Git-based and does not require a PyPI publication.

The benchmark advisory remains unattributed. Raw paired-run artifacts show:

PR revision Small-batch throughput vs its same-runner main baseline 100-tuple batches 1000-tuple batches
4062071 (run) -3.2% +5.6% +2.3%
615bb57 (run) -12.5% -6.7% +0.5%

Only frontend files changed between these revisions. The measured path is a direct identity Python UDF; the R SDK guard is outside that path. These 20-batch, fixed-order PR-then-main measurements do not establish a cause. The seven flagged metrics also include correlated throughput/MB/s and identical p95/p99 values. No performance thresholds or benchmark implementation were changed by the follow-up.

renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 10, 2026
### What changes were proposed in this PR?

Reserve script-level R assignments and `for` iterators when generating a
UI parameter variable. Braces do not create an R scope, and loops inside
calls also bind their iterator in the script environment. These bindings
now reserve their names regardless of nesting, so insertion chooses
`count_2` or the next available suffix.

Skip function bodies and keep named call arguments separate. Only `=`
retains the argument-depth check; `<-`, `<<-`, `->`, `->>` and loop
iterators are recognized inside blocks and calls.

Original R SDK reproduction:

| Value | Before | After |
| --- | --- | --- |
| Supplied UI parameter | 42 | 42 |
| Generated parameter variable after the existing loop | 3 | 42 |
| Existing loop iterator | 3 | 3 |

### Any related issues, documentation, discussions?

Closes apache#9313. Follow-up to apache#9279. The companion runtime PR
Texera/texera-rudf#2 has merged.

### How was this PR tested?

Retested on freshly fetched upstream main `1ec692c5da`. The ten added
binding regressions fail before the review correction and pass
afterward. All 67 R parser tests pass, including controls for
function-local bindings and named call arguments.

From `frontend`:

```text
node --max-old-space-size=4096 node_modules/@angular/cli/bin/ng.js test --watch=false --progress=false --include=src/app/workspace/service/code-editor/r-ui-udf-parameters-parser.spec.ts
67 passed

node --max-old-space-size=4096 node_modules/@angular/cli/bin/ng.js test --watch=false --progress=false --coverage --coverage-reporters=lcovonly
7200 passed, 1 skipped across 253 files

corepack yarn format:fix
corepack yarn format:ci
```

Repository formatting, ESLint and `git diff --check` passed. The earlier
native R 4.5.3 SDK reproduction of the original loop collision remains
unchanged; this follow-up verified the new binding cases through the
production frontend parser.

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

Generated-by: Codex (GPT-6)
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 25, 2026
…9686)

### What changes were proposed in this PR?

Remove code that nothing uses, and constructs that repeat a default or
an alias, from the Python tests, the agent service, three frontend
specs, the AsterixDB source and the RustFS test container, and make an
unreachable error check in the single-node example loader reachable
(**+84/−137 lines**). Only the loader's behavior changes: a workflow
file that `jq` cannot parse is now reported and skipped instead of
aborting the loader.

- **Python tests (14 files):** `test_console_message.py` drops the
unused `internal_queue` and `timed_buffer` fixtures and their imports.
Two tests drop fixture parameters they never read (`executor`,
`a_timestamp`), and `test_proxy_client.py` names an unused loop value
`_`. The others write `dict(...)` calls as literals, return from
fixtures that yield without teardown, drop empty `@pytest.fixture()`
parentheses, merge nested `with` blocks, return a value directly instead
of through a local, take the first element with `next(iter(...))`, and
spell `datetime.timezone.utc`, `socket.timeout` and `bytes()` as
`datetime.UTC`, `TimeoutError` and `b""` (Ruff targets Python 3.11).
- **Agent service:** `src/agent/index.ts` and `src/api/index.ts` only
re-export modules that callers import directly. No file imports either
barrel, and the package entry is `src/index.ts`.
`workflow-system-metadata.ts` drops the unused `OperatorSchema` and
`ValidationError` type imports.
- **Frontend specs:** the dataset and model creator specs drop
`FormsModule` and `HttpClientTestingModule`, which
`createFormlyModalFixture` already provides, and the admin Gmail spec
drops three modules that the standalone component and its stubbed
service do not need.
- **`load-examples.sh`:** tests the `content=$(jq -c .
"$workflow_file")` assignment in the `if` instead of checking `$?` after
it. The script runs under `set -euo pipefail` and `main` calls
`load_workflows` directly, so the old check could never fire: a workflow
file that `jq` could not parse aborted the loader and skipped the files
after it, although the comment above `FAILURES` calls each failure
deliberately non-fatal. Now `print_error` counts the file, the loop
moves on, and `main` still exits non-zero at the end.
`test_load_examples_sh.sh` adds a case with an unparseable workflow
sorted ahead of a good one.
- **AsterixDB source:** `AsterixDBConnUtil` and `AsterixDBSourceOpExec`
assign the version response and the parsed row once as `val`s instead of
overwriting `null` and `None` placeholders.
- **`RustFSContainer`:** drops the Scaladoc lines saying the console is
left disabled. RustFS 1.0.0 enables the console by default, and the
fixture does not override it.

| Event | PR / Commit |
| --- | --- |
| Introduced by | Python tests: apache#1259 (2021-07-23), apache#1498 (2022-04-15),
apache#1452 (2022-05-13), apache#2067 (2023-07-27), apache#1748 (2023-11-09), apache#2815
(2024-09-05), apache#4520 (2026-04-27), apache#4704, apache#4719 and apache#4795 (2026-05-03),
apache#4893 (2026-05-04), apache#6643 (2026-07-20), apache#6988 (2026-07-29), apache#7374
(2026-08-07), apache#7579 (2026-08-13), apache#8067 (2026-08-29), apache#8542
(2026-09-15), apache#9279 (2026-11-04), apache#8704 (2026-11-05), apache#9623
(2026-11-23); agent service: apache#4020 (2025-11-25), apache#4495 and apache#4540
(2026-04-28); frontend specs: apache#6513 (2026-07-18), apache#6576 (2026-07-20),
apache#8068 (2026-08-28); `load-examples.sh`: apache#4247 (2026-03-02); AsterixDB
source: apache#1044 (2021-02-25); `RustFSContainer`: apache#8542 (2026-09-15) |
| Usage removed by | Creator spec modules: apache#9522 (2026-11-22,
`refactor(frontend): share dataset and model resource UI`) moved both
specs to `createFormlyModalFixture`. Everything else: unused,
unreachable or redundant since introduction. |

As of 2026-11-24:
- The AsterixDB placeholders have been overwritten before any read for
over 5 years.
- The console-message fixtures have been unused for over 2 years.
- The `load-examples.sh` check has been unreachable for almost 9 months.
- The agent-service barrels have had no importer for the 7 months the
service has existed.
- The creator spec modules have been redundant for 2 days.

### Any related issues, documentation, discussions?

Closes apache#9685.

### How was this PR tested?

Ran on this branch and on `main` at `424b2a757a` (Windows 11; Python
3.12 with CI's pinned `ruff` 0.14.7; Node 24 with Yarn 4.14.1; Bun
1.3.13; JDK 17; the loader test in an Alpine container with Bash 5.2.21
and jq 1.7.1):

```bash
cd amber
ruff check src/main/python src/test/python
ruff format --check src/main/python src/test/python
pytest $(git diff --name-only --relative origin/main -- src/test/python)
cd ../agent-service
bun test
bun run typecheck
cd ../frontend
npx ng test --watch=false --include='**/user-dataset-creator.component.spec.ts' --include='**/user-model-creator.component.spec.ts' --include='**/admin-gmail.component.spec.ts'
npx tsc --noEmit -p src/tsconfig.spec.json
yarn prettier-eslint --list-different $(git diff --name-only --relative origin/main -- src)
yarn eslint $(git diff --name-only --relative origin/main -- src)
cd ..
sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.source.sql.*" WorkflowCore/Test/compile WorkflowOperator/scalafmtCheckAll WorkflowCore/scalafmtCheckAll "WorkflowOperator/scalafixAll --check" "WorkflowCore/scalafixAll --check"
bash bin/single-node/tests/test_load_examples_sh.sh
```

- **Python:**
  - Ruff passes on all 218 files.
- The 14 changed test files run 288 tests with the same outcome per test
on both sides: 218 pass, 67 are skipped and 3 fail.
- The three failures are timestamp cases in
`test_ui_parameter_contract.py` that expect UTC and come out 8 hours off
in this machine's time zone. They fail the same way on `main`.
- **Agent service:** all 361 tests in 20 files and the typecheck pass on
both sides.
- **Frontend:** the three specs run 37 tests, all passing on both sides.
The spec typecheck, prettier-eslint and ESLint pass.
- **Scala:** the 11 `source.sql` suites, including the three AsterixDB
specs, run 204 tests that all pass on both sides. WorkflowCore's tests
compile, and scalafmt and scalafix pass on both modules.
- **`load-examples.sh`:** `test_load_examples_sh.sh` passes all 11
checks. Against `main`'s loader, the 9 existing checks pass and the 2
new ones fail: `jq` exits 5 at the malformed file, and the loader stops
there without creating the other workflow.

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

Generated-by: Claude Code (Claude Opus 5.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common docs Changes related to documentations feature frontend Changes related to the frontend GUI infra pyamber

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add UI parameter support for R UDF operators

4 participants