Jupytext should refuse to open out of date paired text representations
See original GitHub issueCf. Hari’s question on medium: is it safe to uninstall jupytext
?
Obviously uninstalling is safe. But reinstalling after a while may not be. As text representations have priority over ipynb file, the user that has worked on the ipynb version without jupytext will get the out of date version from the text representation, when he decides to reinstall.
To avoid such a situation (which can be solved by: closing the notebook without saving, and deleting the text file), we should check file timestamps, and refuse to load inputs from text when text seems to be out of date compared to the ipynb file.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Frequently Asked Questions - Jupytext documentation
The text representation only contains the part of the notebook that you wrote ... Please edit ( touch ) the paired .md or...
Read more >Jupytext documentation
The text representation can be edited outside of Jupyter. ... with the above setting, Jupyter will not let you open scripts as notebooks....
Read more >Using at the Command Line - Jupytext documentation
For programs that don't accept pipes, use {} as a placeholder for the name of a temporary file that will contain the text...
Read more >Jupytext ChangeLog
Jupytext will not open a text notebook that is not UTF-8 (#896) ... Jupytext will not load paired notebook when text representation is...
Read more >Paired notebooks - Jupytext documentation - Read the Docs
The text representation can be edited outside of Jupyter. ... Please note that, with the above setting, Jupyter will not let you open...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This can also be an issue if one edits the same notebook from different machines, some might have jupytext installed and some might not. I would suggest you put in the meta data of both the ipynb and text file some hash/version number that would be a more reliable way than just looking at the filesystem filestamp. When the ipynb’s version is higher than the textfile’s, it should take precedence. (Or maybe there can be some dialog to ask if they should be merged together or not, if this is feasible.)
Hi @allenyllee , this is a very old issue so I won’t reopen it, but still I think we can do something for you use case - please see #799.