-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove unwanted elements from cells when saving. #11164
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
Conversation
Kudos, SonarCloud Quality Gate passed!
|
This should also solve #10855 |
Codecov Report
@@ Coverage Diff @@
## master #11164 +/- ##
==========================================
+ Coverage 61.41% 61.43% +0.02%
==========================================
Files 596 596
Lines 32848 32873 +25
Branches 4655 4659 +4
==========================================
+ Hits 20173 20195 +22
+ Misses 12465 11659 -806
- Partials 210 1019 +809
Continue to review full report at Codecov.
|
@@ -75,4 +77,169 @@ suite('Data Science Tests', () => { | |||
assert.ok(onDidChangeActiveTextEditor.calledOnce); | |||
}); | |||
}); | |||
|
|||
suite('Cell pruning', () => { |
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.
Now this is clearly a good function for unit test. Nice.
import { noop } from '../common/utils/misc'; | ||
import { Settings } from './constants'; | ||
|
||
// Can't figure out a better way to do this. Enumerate | ||
// the allowed keys of different output formats. | ||
const dummyStreamObj: nbformat.IStream = { |
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.
We only support notebook format 4, right? This check works, but seems like it could be broken by an older format or a new format change. I think ok for now though.
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.
I believe it would be okay because the output is either
- run by us, so format 4
- pruned by us if format 3. So if you open a format 3 notebook, and changed it, we'd remove all of the output data that didn't match format 3 (assuming we could open it anywya, which we can't). If we ever supported this, we'd probably import and change to format 4 on open.
* Remove unwanted elements from cells when saving. * Fix a sonar warning * FIx another sonar warning
* Remove unwanted elements from cells when saving. (#11164) * Remove unwanted elements from cells when saving. * Fix a sonar warning * FIx another sonar warning * Update changelog
For #11151
The support of transient data broke our saving of a notebook cell. Make sure to prune all unwanted data when saving.