Repository navigation
Replies: 3 comments 3 replies
|
My thoughts:
|
|
I prefer option B. Maybe something like My only concern is the copy button. With B the modal still offers copy, but the copied script won't run without the zip, so someone pasting it into a notebook gets an ImportError and has to figure out why. Could copy give the self-contained version instead, so copy always runs and download gives you the cleaner two-file layout? Related to that, if the problem is that the workflow is hard to find, there's another option that keeps one file. Wrap the workflow code in a |
|
I also prefer B. Having a very long Python script can feel overwhelming, especially if it includes auto-generated code that the user didn't write. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
When a workflow is exported to Python, the script defines every helper function it calls before the workflow code starts. These helpers handle things like number parsing, type casts and null handling. For a small workflow the helpers take up most of the file. With the export series in #8325 applied, a CSV source followed by one Filter exports as 93 lines. 72 of them are seven helper functions, and the workflow itself is 16 lines at the bottom.
I would like to agree on a layout before going further. These are the options I see.
A. Keep everything in one script (current). The script is self-contained and runs with nothing extra. The cost is length, and the workflow logic is hard to find.
The export modal for a CSV, Filter, Sort, Limit and Bar Chart workflow. The first screen is all helper code.
B. Download a zip with a helper module. The zip holds
script.pyandtexera_support.py. The script starts withfrom texera_support import ...and only names the helpers it uses. The module comes from the same Texera that wrote the script, so the two always match, and nothing needs to be installed. The cost is a second file, so a single copy and paste of the script no longer runs. There is a draft prototype in #9240. Below is the same workflow with it, and the button left of copy downloads the zip.C. Publish a PyPI package. The script starts with
pip install texera-supportand imports from it. This gives the shortest script. It needs an Apache release to publish from, a PPMC vote, and a decision on the package name. Each script would also need the package version that matches the Texera that exported it.B and C are compatible. A script written for B keeps the same import line if the package is published later, and only the zip step goes away.
#9240 stays a draft until the export series in #8325 has merged. The outcome here decides whether it moves forward or gets closed.
I'd appreciate hearing everyone's thoughts on these options. Any feedback or suggestions are welcome. Thank you!
All reactions