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

Clarify "Couldn't find cache key" warnings to make clear the root problem is failed execution #51

Open
choldgraf opened this issue Jun 9, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@choldgraf
Copy link
Member

I'm trying to update a test in MyST-NB that requires re-running one of the notebooks. However, the test keeps failing with this error, which I think is independent of MyST-NB:

E       AssertionError: assert '\x1b[31mWARN...x1b[39;49;00m' == ''
E         - WARNING: Execution Failed: /tmp/pytest-of-choldgraf/pytest-304/test_complex_outputs_unrun0/source/complex_outputs_unrun.ipynb
E         - WARNING: Couldn't find cache key for notebook file source/complex_outputs_unrun.ipynb. Outputs will not be inserted.

I can't figure out how to get rid of this error, and it doesn't make sense to me why it'd show up because I think everything in those tests is generated at test-time (at least, the cache etc). Am I doing something wrong? Or is this a bug?

@choldgraf choldgraf added the bug Something isn't working label Jun 9, 2020
@chrisjsewell
Copy link
Member

Well, as the warnings suggest 😉; it can't find the cache key, because the notebook failed to execute, and so wasn't added to the cache.
So either (a) you haven't got all the dependencies installed to run that notebook (my guess), or (b) whatever you have changed is causing the notebook to fail.
You can get the test to print out the full stdout/stderr (can't remember exactly how off-hand), or you can try physically opening the notebook and running it through.

@choldgraf
Copy link
Member Author

choldgraf commented Jun 9, 2020

Ah interesting - OK it makes sense that the execution was failing. I think it was the warnings that threw me off. Because they are printed right after one another, I thought that the execution failed because the cache key couldn't be found. Perhaps there's a more intuitive way of structuring/wording those warnings?

@chrisjsewell
Copy link
Member

Yeh open for any improvements in wording, but

I thought that the execution failed because the cache key couldn't be found

What are you benjamin button lol; the cache key warning follows the execution warning, which surely implies that the execution failure subsequently caused the cache key failure? (i.e. cause precedes effect)

@choldgraf
Copy link
Member Author

I don't think most users are going to analyze their warning messages with the kinds of logical connections that you're showing here lol, most people just look up at the last error message and then assume that's their problem.

@choldgraf choldgraf changed the title Couldn't find cache key error Clarify "Couldn't find cache key" warnings to make clear the root problem is failed execution Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants