-
Notifications
You must be signed in to change notification settings - Fork 65
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
Handle missing notebook metadata file_extension
#127
Conversation
Co-authored-by: Anton Akhmerov <[email protected]>
oops, sorry, accidental close! I meant to ask where we were on this one...are we just waiting on inserting the location for the warning? If so, I'd be +1 on just merging this since it fixes some downstream bugs (I'm not sure how to test this, but that would be good to) |
Having read a bit more about the upstream bug, it seems this addresses a use case where:
Under which conditions does this happen? Or are you using some specific components of jupyter-sphinx as a library? |
Well yes in MyST-NB we are using |
can this be merged @akhmerov? |
@chrisjsewell I thought there is an unresolved conversation and a TODO. What's the status of that? |
oh yeh done 👍 |
Thanks! One last point: you add notebook validation and patching to the code that saves it, which seems to be outside of that function's concern. Wouldn't validation of the metadata be better used outside of that function and before it is called? Or are you using the function directly in myst-nb? |
well it is validated, by nbformat when it is read. But as mentioned, |
OK, sounds reasonable. |
The
file_extension
metadata is added to the notebook by the kernel, during execution.This means that, in cases where the notebook has failed to execute, this line can raise an exception and kill the whole build, for example executablebooks/MyST-NB#175.
If this happens, we would like this line to fail gracefully; either by just not dumping the script file or (as proposed here) defaulting to a specific extension.