-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add --remove-all-notebook-metadata
flag
#163
Add --remove-all-notebook-metadata
flag
#163
Conversation
Codecov ReportBase: 98.07% // Head: 97.02% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #163 +/- ##
==========================================
- Coverage 98.07% 97.02% -1.06%
==========================================
Files 3 3
Lines 156 168 +12
==========================================
+ Hits 153 163 +10
- Misses 3 5 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
As this is branched from #161, I'll wait until that's complete before reviewing this. |
b07f6d6
to
a41a2b3
Compare
#161 is merged. Please review this branch. I will rebase this branch. |
After some reading it seems current behavior of nb-clean is cleaning notebook metadata? |
f12030f
to
3f346ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before we consider merging this, we need to think more about the approach and how to maintain compatibility for existing users.
With this change, there are --preserve-notebook-metadata
and --remove-notebook-metadata
arguments which sound as though they are the inverse of one another but do different things and are toggled independently. This is confusing for users, and also for me to maintain.
--preserve-notebook-metadata
only checks for and removes the language_info.version
key from the metadata, whereas the new --remove-notebook-metadata
argument removes all metadata keys. We need the names to disambiguate this: for example, by renaming --remove-notebook-metadata
to --remove-all-notebook-metadata
or similar.
Even if it were named differently, I'm not keen to maintain two flags so easily confused with each other. Perhaps we should deprecate --preserve-notebook-metadata
? This can be achieved in a sequence of steps across future releases:
- from this change, using
--preserve-notebook-metadata
prints a deprecation warning that the feature will be removed in future - after the deprecation warning has been present for some time, the flag becomes a no-op that prints a warning saying the feature was removed
- eventually, we remove the flag entirely and passing it will result in an argument parsing error
In addition, please can you run the linters and test suite with poetry run poe check
and address the issues raised?
All updated. Please review. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #163 +/- ##
==========================================
+ Coverage 99.46% 99.51% +0.04%
==========================================
Files 3 3
Lines 187 205 +18
==========================================
+ Hits 186 204 +18
Misses 1 1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've made another round of review -- we're making good progress.
All resolved with 100% coverage. Please review. |
This flag is disabled by default, and when enabled will remove all notebook-level metadata.
ffe1870
to
1432d1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for perservering with this.
--remove-all-notebook-metadata
flag
This change is included in the nb-clean 3.3.0 release. |
Add new argument for clean and filter "-M" or "--remove-notebook-metadata" to "remove notebook metadata.