carloea2 opened a new pull request, #4844:
URL: https://github.com/apache/texera/pull/4844
### What changes were proposed in this PR?
This is PR 3 of the UiParameter split stack, based on PR 2.
This PR enables end-to-end execution for Python UDF UiParameters.
Users declare parameters in Python code with `self.UiParameter(...)`. The
frontend parses active declarations, stores editable values in operator
properties, and the backend injects those values into the executed Python UDF.
The Python runtime applies them before `open()` runs.
Supported UiParameter value types:
- string
- integer
- long
- double
- boolean
- timestamp
`BINARY` and `LARGE_BINARY` are intentionally not supported as UiParameter
values.
```mermaid
sequenceDiagram
autonumber
actor User
participant Code as CodeEditorComponent
participant Yjs as Yjs Shared Code
participant Sync as UiUdfParametersSyncService
participant Parser as UiUdfParametersParserService
participant Props as Operator Properties
participant Desc as Scala UDF Descriptor
participant Injector as PythonUdfUiParameterInjector
participant Runtime as Python Runtime
participant Support as _UiParameterSupport
participant UDF as User UDF
User->>Code: Writes self.UiParameter(...)
Code->>Yjs: Updates shared code
Yjs->>Sync: Emits code change
Sync->>Parser: Parse Python code
Parser-->>Sync: Return parameter name/type schema
Sync->>Props: Preserve existing values and update uiParameters
User->>Props: Edits parameter values
Props->>Desc: Submit descriptor with uiParameters
Desc->>Injector: inject(code, uiParameters)
Injector->>Injector: Validate supported types
Injector->>Injector: Generate reserved hook
Injector-->>Desc: Return injected Python code
Desc->>Runtime: Execute injected code
Runtime->>UDF: Load UDF class
UDF->>Support: Wrapped open() applies injected values
UDF->>Support: self.UiParameter(...).value
Support-->>UDF: Return typed runtime value
UDF->>Runtime: Execute workflow logic
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]