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

AttributeError: kernelspec #735

Closed
bisgaard-itis opened this issue Nov 2, 2023 · 3 comments · Fixed by #736
Closed

AttributeError: kernelspec #735

bisgaard-itis opened this issue Nov 2, 2023 · 3 comments · Fixed by #736

Comments

@bisgaard-itis
Copy link

🐛 Bug

When using the Papermill version 2.5.0 I encountered an issue when using parametrized notebooks. I believe this is a bug because it doesn't happen in version 2.4.0.

I have created a small test case which reproduces the bug:
testcase.zip
The zip contains test.py and test.ipynb which should sit next to each other when test.py is run. The log I get when I run this test case is

Traceback (most recent call last):
  File "/home/mads/Development/oSparc/osparc-simcore-clients/clients/python/test/e2e/test.py", line 12, in <module>
    pm.execute_notebook(
  File "/home/mads/Development/oSparc/osparc-simcore-clients/.venv/lib/python3.10/site-packages/papermill/execute.py", line 94, in execute_notebook
    parameter_predefined = _infer_parameters(nb)
  File "/home/mads/Development/oSparc/osparc-simcore-clients/.venv/lib/python3.10/site-packages/papermill/inspection.py", line 41, in _infer_parameters
    kernel_name = nb.metadata.kernelspec.name
  File "/home/mads/Development/oSparc/osparc-simcore-clients/.venv/lib/python3.10/site-packages/nbformat/_struct.py", line 125, in __getattr__
    raise AttributeError(key) from None
AttributeError: kernelspec

@MSeal
Copy link
Member

MSeal commented Nov 2, 2023

Thanks for raising with an example. I'll take a look this week and see what the root problem is, though the code related to this shouldn't have changed in papermill iirc.

@MSeal
Copy link
Member

MSeal commented Nov 2, 2023

Found the issue -- technically the notebook spec requires it specify some metadata that a new code path reads. Other paths in papermill raise a clearer message and require an metadata override argument in these cases. I'll unify the pattern a bit here and get a patch release going.

@bisgaard-itis
Copy link
Author

Found the issue -- technically the notebook spec requires it specify some metadata that a new code path reads. Other paths in papermill raise a clearer message and require an metadata override argument in these cases. I'll unify the pattern a bit here and get a patch release going.

Thanks @MSeal. We use Papermill in our testing, so we very much appreciate the quick response time here 😄 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants