Skip to content
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

Support configuring default ipynb format or change to a new minimum version #11288

Open
1 of 2 tasks
abhimanyu-bitsgoa opened this issue Sep 4, 2022 · 10 comments
Open
1 of 2 tasks
Assignees
Labels
feature-request Request for new features or functionality notebook-serialization Applies to conversion of ipynb file to JSON & vice versa

Comments

@abhimanyu-bitsgoa
Copy link

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

Whenever you are creating new .ipynb files, you will by default create the nbformat_minor version as 2. Can't seem to change this behaviour.

VS Code Version

1.71.0

Jupyter Extension Version

v2022.8.1002431955

Jupyter logs

No response

Coding Language and Runtime Version

No response

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

No response

@abhimanyu-bitsgoa abhimanyu-bitsgoa added bug Issue identified by VS Code Team member as probable bug triage-needed Issue needs to be triaged labels Sep 4, 2022
@DonJayamanne DonJayamanne self-assigned this Sep 5, 2022
@DonJayamanne
Copy link
Contributor

Thanks for filing this issue, currently there's no way to change this.

  • What would you like this changed to?
  • Out of curiosity why do you want a different value?

@DonJayamanne DonJayamanne added feature-request Request for new features or functionality notebook-serialization Applies to conversion of ipynb file to JSON & vice versa and removed bug Issue identified by VS Code Team member as probable bug triage-needed Issue needs to be triaged labels Sep 5, 2022
@abhimanyu-bitsgoa
Copy link
Author

Thanks for filing this issue, currently there's no way to change this.

  • What would you like this changed to?
  • Out of curiosity why do you want a different value?

I am using nbformat to read a notebook string into a NotebookNode and it is facing a validation problem (as given here). The fix is to change the minor version to 5. But when someone will author a new notebook, it will again be with minor version 2.

So ideally we want it to be changed to 5.

@DonJayamanne
Copy link
Contributor

thanks, however I'm still struggling to understand this issue.
please could you provide a sample code with instructions and with the versions of the packages used so i can repro this issue at my end

@abhimanyu-bitsgoa
Copy link
Author

Sure!

Steps to repro this issue:

  1. Use nbformat 5.4.0 version
  2. Create a notebook with major version = 4 and minor version =2
  3. Call nbformat.read(...) on the notebook string and it will generate a Notebook JSON failed error

Please let me know if you need my help in the repro.

@abhimanyu-bitsgoa
Copy link
Author

Please let me know if you need anymore info from my side.

@DonJayamanne
Copy link
Contributor

Sorry, forgot to get back to you, thanks I'll take a look at this..

@hhalaby
Copy link

hhalaby commented Nov 29, 2022

@DonJayamanne I see that something has been merged for this. Is it now possible to specify the nbformat version by default ?

@DonJayamanne
Copy link
Contributor

Unfortunately we haven't fixed this yet.

@DonJayamanne DonJayamanne removed the triage-needed Issue needs to be triaged label Dec 14, 2023
@DonJayamanne DonJayamanne changed the title nbformat_minor version is by default 2 for new .ipynb files Support configuring default ipynb format or change to a new minimum version Mar 18, 2024
@Younthing

This comment has been minimized.

@DonJayamanne
Copy link
Contributor

@Younthing Please can you file a new issue for what you are running into.
We do not upgrade versions from 4.2 to 4.5, unless your notebook already has an id property or the like (I suspect it has the cell id).
Either way, please file a new issue with simple steps to repro, e.g. create a new notebook with 4.2 as version and how it gets changed to 4.5 (do you save, etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality notebook-serialization Applies to conversion of ipynb file to JSON & vice versa
Projects
None yet
Development

No branches or pull requests

4 participants