Skip to content

Name a model or dataset from a Python UDF parameter #6895

Closed

Description

@aicam

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:

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

  • Other (feature implementation — engine + UI)

Activity

  1. added theissue type on Jul 25, 2026
  2. changed the title [-]Consume mounted datasets in Python UDFs[/-] [+]Name a model or dataset from a Python UDF parameter[/+] on Sep 8, 2026
  3. added a commit that references this issue on Sep 21, 2026
    60a37b1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions