You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
outputs in cells are optional, but sometimes we also want the outputs to be empty slices ("outputs": []). So, it should not be omitted.
Therefore, even if the original JSON cells do not have an outputs key or if the value of outputs is null, the cells in the result will always include "outputs": [].
Should we use
omitempty
for optionals or not?nbformat
spec andomitempty
metadata.kernelspec.language
cell.execution_count
If the original JSON contains these keys with empty strings (
""
) ornull
values, the keys and values will be omitted in the result due toomitempty
.nbformat
spec, but NOTomitempty
cell.outputs
outputs
in cells are optional, but sometimes we also want the outputs to be empty slices ("outputs": []
). So, it should not be omitted.Therefore, even if the original JSON cells do not have an
outputs
key or if the value ofoutputs
isnull
, the cells in the result will always include"outputs": []
.Possible solution: We need
omitnil
.See golang/go#22480
The text was updated successfully, but these errors were encountered: