Skip to content

A workflow cannot be taken out of Texera as a script that runs on its own #8325

Description

@kz930

Feature Summary

A workflow can be built and read in the editor, but there is no form of it that runs anywhere else. A user who wants to keep a pipeline after the fact, hand it to a colleague who does not run Texera, or step through it in a notebook has nothing to take away.

What is missing is an export: given a plan, produce a single Python file that reads the same sources, applies the same operators in the same order, and prints its results. The operators already describe their work as Python for the engine, so the pieces exist; what is absent is a form of that description that stands on its own, without the runtime around it, and something to stitch the pieces into one script.

Proposed Solution or Design

An operator says how it reads outside the engine by implementing a StandaloneCodeGenerator trait, returning a block of pandas that names its inputs and outputs by position: in1df, in2df, out1df. A translator walks the plan in topological order, gives every output port a variable, substitutes those placeholders for the variables its upstreams were given, and prints the leaves. A variadic port, of which Union is the one example, needs the whole list of upstreams rather than a fixed count, since any count the operator states would be wrong for some workflow.

The compiling service exposes the result as an endpoint, so the editor can offer the script for a plan the user has open.

An operator that has no generator yet leaves a commented placeholder in the script rather than a line that looks like it works, so the export is useful before every operator implements it.

The set, in order

  1. Export a workflow as a standalone Python script: the trait, the translator and the endpoint #8407, the export itself: the trait, the translator, the endpoint and five operators. PR feat(workflow-compiling-service): export a workflow as a standalone Python script #8327
  2. Run an operator through the engine and keep what it wrote #8408, running an operator through the engine. PR test(verify): run an operator through the engine and keep what it wrote #8356
  3. Run a Python operator the way the engine runs it #8409, running a Python operator the way the engine runs it. PR test(verify): run a Python operator the way the engine runs it #8357
  4. Run the script the export produces #8410, running the script the export produces. PR test(verify): run the script the export produces #8358
  5. Compare what the two paths produced #8411, comparing what the two paths produced. PR test(verify): compare what the two paths produced #8359
  6. Give every operator the same table to read #8412, the canonical table every operator reads. PR test(verify): give every operator the same table to read #8360
  7. Hand-write the configurations a schema cannot describe #8413, the configurations a schema cannot describe. PR test(verify): hand-write the configurations a schema cannot describe #8363
  8. Export the base transform operators as Python #8414, base transforms. PR feat(workflow-operator): export the base transform operators as Python #8340
  9. Export the source operators as Python #8415, sources. PR feat(workflow-operator): export the source operators as Python #8341
  10. Export the hierarchy and graph visualizations as Python #8416, visualizations: hierarchies and graphs. PR feat(visualization): export the hierarchy and graph charts as Python #8344
  11. Export the charts that draw over a table's columns #8417, visualizations: charts over a table's columns. PR feat(visualization): export the charts that draw over a table's columns #8365
  12. Export the tables, ranges and embedded documents #8418, visualizations: tables, ranges and embedded documents. PR feat(visualization): export the tables, ranges and embedded documents #8366
  13. Export the coordinate-system and domain plots as Python #8419, visualizations: coordinate systems and domains. PR feat(visualization): export the coordinate-system and domain plots as Python #8346
  14. Export the four advanced trainers, and write their hyperparameter rules into the schema #8420, the four advanced trainers. PR feat(machine-learning): export the four advanced trainers #8348
  15. Export the Machine Learning Scorer #8421, the Machine Learning Scorer. PR feat(machine-learning): export the Machine Learning Scorer #8367
  16. Export the scikit-learn estimators and the Hugging Face models #8422, the estimators and the Hugging Face models. PR feat(operator): export the estimators and the Hugging Face models #8368
  17. Derive an operator's configuration from its schema #8423, deriving a configuration from an operator's schema. PR test(verify): derive an operator's configuration from its schema #8361
  18. Sweep a configuration into the variants a parity run needs #8424, the sweep that turns one configuration into the variants a parity run needs. PR test(verify): sweep a configuration into the variants a parity run needs #8388
  19. Run every operator both ways and report what it did #8425, running every operator both ways and reporting what it did. PR test(verify): run every operator both ways and report what it did #8362
  20. Run the source operators, and report what is covered #8426, the source operators, and the coverage report. PR test(verify): run the source operators, and report what is covered #8364
  21. Export a workflow as Python from the editor, and read the schema's constraints in the property panel #8427, the editor: the export button and the property panel. PR feat(gui): export a workflow as Python, and read the schema's constraints in the panel #8350

Each is sized to be read in one sitting. Deriving a configuration was the one that was not, at two thousand lines, so it is now two: the entry that produces one configuration, and the entry that sweeps it into the variants. The two share no member, and no line moved between them. The export comes first, then the machinery that runs an operator both ways, then the operator families that implement the trait, then the two changes that read every operator at once — those come after the families so their assertions hold as written — and the editor last. This issue stays open until the final one lands.

What the order actually requires

The list above is one order that works, but it is not a queue.

graph LR
  E["PR 8327<br/>the export"]
  H["PR 8356<br/>engine harness"]
  FAM["operator families<br/>8340 8341 8348 8367 8368<br/>8344 → 8346 8365 8366"]
  P["PR 8357<br/>python harness"]
  R["run and compare<br/>8358 8359"]
  T["PR 8360<br/>canonical table"]
  C["configurations<br/>8361 8363"]
  SW["PR 8388<br/>sweep"]
  RUN["PR 8362<br/>run every operator"]
  COV["PR 8364<br/>coverage report"]
  UI["PR 8350<br/>the editor"]

  E --> FAM
  E --> R
  H --> P
  H --> T
  P --> R
  T --> C
  FAM -->|"@SampleColumn"| C
  R --> RUN
  C --> RUN
  C --> SW
  RUN --> COV
  SW --> COV
  E -.->|endpoint only| UI
Loading

Affected Area

Workflow Engine (Amber), Workflow UI

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions