Repository navigation
Description
Feature Summary
The import modal decides which prompts a conversion uses from where the user uploads: the Python Notebook / R Notebook switch on the Jupyter Notebook tab, or the Python File, Python Folder, R File and R Folder tabs. Today only one mismatch is checked, and even that one can point users to the wrong place:
- An R notebook uploaded as a Python Notebook is accepted. Its R code goes to the Python prompts, and the user gets a workflow of broken Python UDFs that only fails once it runs.
- A notebook with a kernel other than Python or R, such as Julia, converts as Python when uploaded as a Python Notebook. When uploaded as an R Notebook it is rejected, but the message tells the user to switch to Python Notebook, which would not work either.
- A notebook with no
kernelspecis never checked, even when itslanguage_info.namesays which language it is. - A
.pyfile on an R tab, or a.Rfile on a Python tab (drag and drop gets past the file picker's filter), gets a generic hint that does not say which tab accepts it. - A folder of Python files on the R Folder tab, or of R files on the Python Folder tab, gets "No R files were found in the selected folder." That is true, but it does not say where to go instead.
- An empty R file is reported internally as "The Python file is empty."
Proposed Solution or Design
Check the upload against the selected language in the dashboard, before any model call, and tell the user exactly where it belongs:
- Notebooks: read the language from
metadata.kernelspec.language, falling back tometadata.language_info.name, ignoring case. A notebook with neither is accepted as it is today, and guessing the language from the code is left to the model. - Files: go by the extension. Unknown extensions keep today's hint.
- Folders: when a folder has no files in the selected language but does have files in the other one, say so. Every other folder keeps today's checks.
The messages would be:
| Upload | Message |
|---|---|
| R notebook as a Python Notebook | This notebook uses an R kernel, not Python. Switch the notebook type to R Notebook. |
| Python notebook as an R Notebook | This notebook uses a Python kernel, not R. Switch the notebook type to Python Notebook. |
| Any other kernel | This notebook uses a julia kernel. Only Python and R notebooks can be converted. |
| R file on a Python tab | This is an R file. Upload it under the R File tab. |
| Python file on an R tab | This is a Python file. Upload it under the Python File tab. |
| Python folder on R Folder | This folder holds Python files, not R. Upload it under the Python Folder tab. |
| R folder on Python Folder | This folder holds R files, not Python. Upload it under the R Folder tab. |
When the right place is an R option and R is not enabled on the deployment, the message says that instead of pointing at a disabled control, for example "This notebook uses an R kernel, and R is not enabled on this deployment."
This makes the Python side a little stricter, but only for uploads that could never have produced a working workflow. The checks are driven by the per language table the dashboard already uses, so a future language gets them without new branches. The internal read errors for scripts will also name the right language.
Affected Area
Workflow UI
Activity
zyratlo commentedon Oct 8, 2026
/parent-issue #4301
zyratlo commentedon Oct 8, 2026
/take
feat(notebook-migration): add r notebooks to the import modal (apache…
feat(notebook-migration): add r files to the import modal (apache#8963)
feat(notebook-migration): add r folders to the import modal (apache#9427