Skip to content
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

KeyError: 'execution_count' #83

Closed
kernc opened this issue Sep 18, 2018 · 4 comments
Closed

KeyError: 'execution_count' #83

kernc opened this issue Sep 18, 2018 · 4 comments

Comments

@kernc
Copy link
Contributor

kernc commented Sep 18, 2018

Attached minimal Jupyter notebook (strip ".txt"), given the following two commands, applied in series, results in the following error:

$ jupytext --to py error\ example2.ipynb
$ jupytext --test --update --to ipynb error\ example2.py

Traceback (most recent call last):
  File "/home/user/testing/venv/bin/jupytext", line 11, in <module>
    sys.exit(jupytext())
  File "/home/user/testing/venv/lib/python3.5/site-packages/jupytext/cli.py", line 129, in jupytext
    preserve_outputs=args.update)
  File "/home/user/testing/venv/lib/python3.5/site-packages/jupytext/cli.py", line 38, in convert_notebook_files
    test_round_trip_conversion(notebook, ext, preserve_outputs)
  File "/home/user/testing/venv/lib/python3.5/site-packages/jupytext/compare.py", line 88, in test_round_trip_conversion
    test_outputs=True)
  File "/home/user/testing/venv/lib/python3.5/site-packages/jupytext/compare.py", line 65, in compare_notebooks
    ref_cell = filtered_cell(ref_cell, preserve_outputs=test_outputs)
  File "/home/user/testing/venv/lib/python3.5/site-packages/jupytext/compare.py", line 16, in filtered_cell
    filtered['execution_count'] = cell['execution_count']
KeyError: 'execution_count'

error example2.ipynb.txt

Jupytext 0.6.5

@mwouts
Copy link
Owner

mwouts commented Sep 18, 2018

Thanks @kernc for reporting this. This is very useful. Let me try to turn your example into an additional test...

mwouts added a commit that referenced this issue Sep 18, 2018
@mwouts
Copy link
Owner

mwouts commented Sep 18, 2018

The fix is on branch v0.7.0, but that branch is not stable yet, so I do not recommend that you use it now. Please wait a few more days before I can release it... Thanks

mwouts added a commit that referenced this issue Sep 19, 2018
@mwouts
Copy link
Owner

mwouts commented Sep 22, 2018

A prerelease is available. Try it with:

pip install jupytext==0.7.0rc0

@mwouts mwouts closed this as completed Sep 22, 2018
@kernc
Copy link
Contributor Author

kernc commented Sep 22, 2018

Verified works great. Thanks!

@mwouts mwouts mentioned this issue Sep 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants