Remove unwanted elements from cells when saving.#11164
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.
|
| }); | ||
| }); | ||
|
|
||
| suite('Cell pruning', () => { |
There was a problem hiding this comment.
Now this is clearly a good function for unit test. Nice.
|
|
||
| // 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.
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.
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.