question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to remove `lines_to_next_cell` metadata

See original GitHub issue

If I have the following global configs:

c.NotebookApp.contents_manager_class = "jupytext.TextFileContentsManager"
c.ContentsManager.freeze_metadata = True

When I open a .py script that has the following content:

import os


print('hello1')



print('hello2')



Then hit the button “Save and Checkpoint” in the browser interface and open the script again in a text editor, the new content of the script is:

# + {"lines_to_next_cell": 2}
import os
# -


print('hello1')



# + {"lines_to_next_cell": 2}
print('hello2')



I’ve also tried to have in the global configs the following:

c.NotebookApp.contents_manager_class = "jupytext.TextFileContentsManager"
c.ContentsManager.freeze_metadata = True
c.ContentsManager.default_cell_metadata_filter = "-lines_to_next_cell"

But the behavior is still the same.

Shouldn’t the c.ContentsManager.freeze_metadata option save no metadata at all when the original files have no metadata?

If not, how can I remove the lines_to_next_cell metadata in this scenario?

Thanks in advance!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
mwoutscommented, Feb 6, 2019

Andre, there was indeed an issue with the combination of the user and the default filter. The fix is on its way. What I advice for now is that you remove the default cell metadata filter filter (as, anyway the metadata lines_to_next_cell is not expected to go to the text representation anymore).

1reaction
mwoutscommented, Dec 7, 2018

Hello Andre, Thanks for reporting this - this is clearly not intended !

For the next release I have been thinking of removing the freeze_metadata option and instead provide a better handling by default of scripts with no metadata (and, as you expect, add no metadata in that case - see also #124).

I am not in a position to test your example right now, but I will later on. Meanwhile, you may want to edit the metadata filter manually (in the notebook metadata), or give a try to the following configuration,

c.NotebookApp.contents_manager_class = "jupytext.TextFileContentsManager"
c.ContentsManager.default_notebook_metadata_filter = "-all"
c.ContentsManager.default_cell_metadata_filter = "-all"
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Easily Remove Metadata from Files via File Explorer
Windows: How to Easily Remove Metadata from Files via File Explorer · Go to File Explorer · Select one or more files in...
Read more >
unable to remove properties and personal information ...
Unable to remove properties and personal information from video files because that is missing. was there the other day but is missing now....
Read more >
Cannot remove data from user_metadata with service role via ...
I expected being able to delete properties from the user_metadata object. I certainly should not have to edit the auth.users table row directly ......
Read more >
52456 - Unconfigure fails with message, "Unable to delete the ...
System Reported Fixed* Reported Fixed* Microsoft® Windows® for x64 5.1 6.1 9.3 TS1M1 9.4 TS1M0 Microsoft Windows Server 2003 Datacenter Edition 5.1 9.3 TS1M1 Microsoft Windows...
Read more >
Is it possible to remove metadata by installing a newer version ...
To remove metadata from installed org, you need to use destructive changes with Ant/Workbench(or similar tool).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found