-
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
Fixes #634 bug: no metadata
attribute
#635
Fixes #634 bug: no metadata
attribute
#635
Conversation
- following the pattern from `FileContentsManager.save` in the `notebook` package
Codecov Report
@@ Coverage Diff @@
## test_jupyterfs_metamanager #635 +/- ##
===========================================================
Coverage 99.20% 99.20%
===========================================================
Files 94 94
Lines 9333 9334 +1
===========================================================
+ Hits 9259 9260 +1
Misses 74 74
Continue to review full report at Codecov.
|
f798835
to
a007c67
Compare
To my surprise, the fixes in #634 and #635 seem to be sufficient to fix all of the issues causing problems between jupytext and jupyter-fs. I still think it's kind of a problem that
instead of
But apparently |
Thank you @telamonian , that is very helpful! I agree with the two commits: it is important to give more details when an exception occurs, and then you're right, I missed the conversion step that is performed in the parent I think I also see why the tests missed the problem... Many of the tests call Also I will double check that we can still trust text notebooks... Your research shows that we won't call the |
Well, that makes a total of three PR on the subject 😄 jupytext/tests/test_contentsmanager.py Lines 1735 to 1821 in af2b15b
I quite agree with you... the other way around seems simpler... but, in the end, the purpose of #634 and #635 is to make Jupytext work on top of any contents manager, and a MetaManager is still a contents manager, isn't it? And also maybe it is simpler to wrap Jupytext around a single contents manager rather than around each of the sub managers? |
I agree with your ambivalence. The current way in this PR seem to work, so let's roll with it 👍 If it does cause problems down the line, I'll add a |
Fixes the bug mentioned in #634 (comment). Previously, the monkey patch here:
jupytext/jupytext/contentsmanager.py
Lines 172 to 173 in aea84d9
called the parent
save
method, which would then callnbformat.from_dict
:before eventually calling
jupytext.writes
(via the patchednbformat.writes
) as part of the_save_notebook
call.In the current code,
jupytext.writes
(which expects aNotebookNode
, not just a notebook dict) is called before the parent save method:jupytext/jupytext/contentsmanager.py
Lines 155 to 161 in af2b15b
so we need to explicitly add a conversion from dict to
NotebookNode
somewhere.@mwouts Not sure if I put the
nbformat.from_dict
call in the ideal spot (I assume you know more about this than I do), but it does seem to fix the problem.