apache / apache/texera

[Notebook Migration] Support migrating R code

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

Description

### Feature Summary

The migration tool assumes Python throughout. The prompts in `migration-prompts.ts` describe the task as translating Python and teach the model Texera's Python tuple, table, and operator interfaces, and `migration-llm.ts` builds every generated operator from the `PythonUDFV2` schema. We want to support R next after Jupyter notebook and Python.

### Proposed Solution or Design

Extend the migration tool to accept R input and generate R UDF operators instead of Python ones.

The structural work is parameterizing by language what is currently hardcoded to Python:

* The prompt set needs an R equivalent, teaching the model Texera's R UDF interface the way the current prompts teach the Python one.
* Operator construction needs to select the R UDF descriptor rather than always using `PythonUDFV2`.
* The tool needs to know which language it is looking at, whether from the file extension, the notebook kernel metadata, or an explicit choice in the import modal.

Everything else the tool does is language-agnostic and should carry over unchanged: the upload path, the cell-to-operator mapping and highlighting, the workflow assembly, and the delete path.

Related considerations to work out when this is picked up:

* Whether a workflow can mix R and Python operators, and whether the tool should ever produce one.
* How this composes with the plain-file and folder inputs added for Python, since those raise the same "what is a unit" question independently of language.

This is follow-up work after the Jupyter notebook migration tool is complete, and it builds on the Python input work. 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.