apache / apache/texera

[Notebook Migration] Support migrating Python files

Closed
#8,007 2 comments 0 reactions 1 assignee Claimed by @zyratlo View on GitHub
Dominant language
Scala
Stars
314
Forks
187
Avg merge
1d 21h
Merged PRs (30d)
214

Description

### Feature Summary

The migration tool converts a Jupyter notebook into a Texera workflow. A notebook is the only accepted input: the import modal takes a single `.ipynb`, and the conversion depends on the notebook's cell structure, both to give the LLM natural unit boundaries and to build the cell-to-operator mapping that drives highlighting in the workspace.

Plain Python files are the next input we want to support. Users with existing code outside Texera often have `.py` scripts rather than notebooks, and today the only way to migrate one is to convert it into a notebook by hand first.

### Proposed Solution or Design

Accept a `.py` file as an input to the migration tool and produce a workflow from it, reusing the notebook path wherever it already generalizes.

The open question is what replaces the cell boundary. A notebook arrives pre-segmented and the tool keys its mapping off per-cell UUIDs; a script does not, so the tool needs some notion of a unit to map operators back to. Whether that is a line range, a syntactic block, an LLM-chosen segmentation, or something else is not decided here.

Related considerations to work out when this is picked up:

* What the Jupyter panel shows for a `.py` input, given that it currently embeds the source notebook and highlights the cell matching the selected operator. Can choose to not show anything at all for Python files.
* Whether the file is still uploaded to the Jupyter workspace, and under what name, following the `notebook_.ipynb` convention
* Whether existing notebook migrations are affected at all, or whether this is purely additive.

This is follow-up work after the Jupyter notebook migration tool is complete. It is not scoped or designed yet.

### Affected Area

Other

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.