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

Ensure we set jupytext metadata to model #1197

Merged
merged 1 commit into from
Jan 13, 2024

Conversation

mahendrapaipuri
Copy link
Contributor

The bug shows up when the user unpairs all the formats. It is reproducible in both notebook and JupyterLab.

Fixes #1191

* When selectedFormts are empty, we return before setting jupytext metadata

* So, the changes are not being comitted to notebook model

* This commit fixes it by ensuring we always set metadata before returning

* Use console.debug instead of console.log to reduce log pollution

Signed-off-by: Mahendra Paipuri <[email protected]>
Copy link

Thank you for making this pull request.

Did you know? You can try it on Binder: Binder:lab or Binder:notebook.

Also, the version of Jupytext developed in this PR can be installed with pip:

pip install git+https://github.com/mahendrapaipuri/jupytext.git@bugfix_nb_unpair

(this requires nodejs, see more at Developing Jupytext)

@mahendrapaipuri
Copy link
Contributor Author

@mwouts Could you please test this patch and see if it fixes the bug? Cheers!!

Copy link

codecov bot commented Dec 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (81d4d33) 97.73% compared to head (c61cb04) 97.73%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1197   +/-   ##
=======================================
  Coverage   97.73%   97.73%           
=======================================
  Files          29       29           
  Lines        4456     4456           
=======================================
  Hits         4355     4355           
  Misses        101      101           
Flag Coverage Δ
external 75.05% <ø> (-0.12%) ⬇️
functional 88.56% <ø> (ø)
integration 77.31% <ø> (ø)
unit 66.56% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mahendrapaipuri
Copy link
Contributor Author

@mwouts Just a gentle reminder in case you missed it during the holidays. If confirm that this patch fixes the bug, we can go for a merge!

@mwouts mwouts added this to the 1.16.1 milestone Jan 12, 2024
@mwouts
Copy link
Owner

mwouts commented Jan 12, 2024

Thank you @mahendrapaipuri !

Yes I have finally tested this PR on Binder - sorry for the long delay - and I can confirm that it works. I will take it tomorrow (after #1204 or #1190 which I need to fix the CI).

@mwouts mwouts merged commit f596a3c into mwouts:main Jan 13, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to unpair ipynb in jupyter notebook
2 participants