zyratlo opened a new issue, #8929:
URL: https://github.com/apache/texera/issues/8929

   ### Feature Summary
   
   The import modal has a tab per source language, and the language a user 
picks decides which prompts the conversion uses. Only one mismatch is caught 
today: a notebook uploaded on the R Code tab whose kernel is not R is rejected 
with "This notebook uses a python kernel, not R. Upload it under the Jupyter 
Notebook tab."
   
   The other mismatches go through or get a generic message:
   
   * An R notebook uploaded on the Jupyter Notebook tab is not checked. Its R 
code is sent to the Python prompts, and the result is a workflow of broken 
Python UDFs that the user only discovers when it fails to run.
   * A notebook with no `kernelspec` is not checked on either tab, even when 
its `language_info.name` names the language.
   * A `.py` file on the R Code tab, or a `.R` file on the Python File tab, 
gets the generic "Please upload a Jupyter Notebook (.ipynb) or an R (.R) file." 
without pointing to the tab that accepts it.
   
   ### Proposed Solution or Design
   
   Check the upload against the selected language in the dashboard dispatch, 
before any model call, and name the tab that fits:
   
   * Notebooks on either tab: compare `metadata.kernelspec.language` with the 
selected language, case insensitively, falling back to 
`metadata.language_info.name` when there is no kernelspec. On a mismatch, 
reject with a message naming the right tab, such as "This notebook uses an R 
kernel, not Python. Upload it under the R Code tab."
   * Scripts: when the extension belongs to the other language, say so and name 
its tab, such as "This is a Python file. Upload it under the Python File tab." 
Unknown extensions keep the current message.
   * A notebook with neither field is accepted on whichever tab it was 
uploaded, as today. Guessing the language from the code is left to the model.
   
   This makes the Jupyter Notebook tab stricter, but only for notebooks that 
would have produced broken workflows. The checks and messages live in the per 
language table the dashboard dispatch already uses, so R folders and any later 
language get them without new branches.
   
   Depends on #8912, which adds the R Code tab and the existing kernel check.
   
   ### Affected Area
   
   Workflow UI


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to