-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding scala support to jupytext extension #253
Merged
mwouts
merged 2 commits into
mwouts:master
from
TIKI-Institut:add_scala_to_jupyter_languages
Jun 13, 2019
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add
'scala'
here only if there exists a jupyter magic command with the same name. Is that the case? Do you see any trouble with scala notebooks represented as Markdown files when you don't add'scala'
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello mwouts,
thank you for your fast reply.
When we do not define scala in the list of _JUPYTER_LANGUAGES, then *.scala files can not be opened as a notebook in Jupyterhub. You are limited to work only on source files...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're welcome.
Well the classification of
.scala
files as notebooks comes from having added a.scala
entry in the_SCRIPT_EXTENSIONS
dictionary, not fromJUPYTER_LANGUAGES
.I have found no
%%scala
magic in Python notebooks. The sparkmagic extension does provide%%sql
and%%spark
, but not%%scala
- If you'd like, we could addsql
andspark
(instead ofscala
) toJUPYTER_LANGUAGES
.Do you think you will be able to contribute a sample scala notebook (does not need to be complex)? It should go to
tests/notebooks/ipynb_scala
, and then you will have to modifytests/test_mirror.py
to add the following:Running the tests will generate the text representations - I need your help here to make sure these are legitimate scala files! Please let me know if you need more details. And thanks again for your contribution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a simple scala notebook to see if the corresponding tests work...
We are using the Apache Toree plugin (https://toree.incubator.apache.org/), which have a lot of scala magics:
https://github.com/apache/incubator-toree/blob/master/etc/examples/notebooks/magic-tutorial.ipynb