Name a model or dataset from a Python UDF parameter
- Dominant language
- Scala
- Stars
- 314
- Forks
- 187
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 214
Description
### Task Summary
**Name a model or dataset from a Python UDF parameter** — the user-facing step of #6606, on the mount endpoint from #6863.
A Python UDF declares a parameter whose value is a resource rather than free text:
```python
class ProcessTupleOperator(UDFOperatorV2):
def open(self):
model_dir = self.UiParameter("IRIS_MODEL", AttributeType.STRING, value=Resource.MODEL)
self.model = joblib.load(f"{model_dir}/iris.pkl")
```
The parameter stays an ordinary string; only where the string comes from differs. The property panel offers that resource's browser instead of a text box, the user picks a *version*, and what the UDF receives at run time is the local directory that version is mounted at. There is no separate "mount" action anywhere in the UI — naming the resource is the whole gesture.
What this needs:
- **`Resource` in pytexera**, passed as `value=`, restricted to string parameters, so the declaration lives in the UDF's own code next to the use.
- **Parsing that declaration in the editor**, so the property panel knows which rows name a resource, and a **resource value editor** that opens the model or dataset browser and stores the chosen version's path. A model browser is new; the dataset browser already exists.
- **Resolving a version path to the repository and commit backing it.** The path parsing the resolver already does for file paths stops one segment earlier, so both kinds of path share it.
- **An engine client for the mount endpoint**, which asks with the computing unit's own user JWT and waits for the propagated mount to appear in the pod. The computing-unit pod is created at run time rather than templated, so the manager passes it the address of the service to ask.
- **Deferred resolution.** Turning a version path into a repository and commit is a database round trip, and the value the UDF ends up with is a directory inside a particular computing unit — neither belongs on the compile path, which runs again on every edit. The operator carries an execution-time binding instead: forced once when the execution starts, it yields both the code with each mount path substituted in and the locators behind those paths.
- **Mounting once per region.** The region scheduler gathers the deduplicated set of locators its operators name and mounts them all before handing any operator its code. Operators carry no mount code of their own; an operator participates by populating the set.
### Task Type
- [x] Other (feature implementation — engine + UI)
Contributor guide
Assessment
This issue has not been assessed yet.