-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Exceptions raised when executing notebooks via the %run magic command #12301
Conversation
This seems good to me! Do you think we could add a test to make sure that this will properly fail when run on a notebook w/ a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to change all the places with a return
above the line you edited to instead raise the given exception (or create one). Otherwise typos or missing files will error silently and not raise as well.
Doesn't have to be notebook specific. A test could be to call the |
@MSeal I've added some additional exceptions. Is that what you were after? |
@palewire Yep. I think you missed one more: ipython/IPython/core/magics/execution.py Line 676 in 6bde670
|
Okay @MSeal, I've added that one yet too. Anything else I can do? |
Probably to make this mergable, we need some updated or new tests in https://github.com/ipython/ipython/blob/master/IPython/core/tests/test_run.py. Thanks for contributing and getting this fixed btw :) |
@Carreau Can comment if there's anything else since he's the maintainer here |
I've pushed a fresh commit with some unit tests. Take a look and let me know what else I can do. |
Nice! It looks good to me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks, guys. @Carreau, let me know if there's anything else I can do. |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
Thanks, looks good, sorry this ended up hidden with all the open PRs. |
… via the %run magic command
… via the %run magic command
Backport PR #12301: Exceptions raised when executing notebooks via the e %run magic command
A first step toward fixing #12291. I only addressed the execution of ipynb files because I lacked the confidence to edit the complex shell operations below.
It's unclear to me if you would want the ultimate solution to be this narrowly tailored, or if you'd prefer other elements of this function to change behavior as well. If you let me know what you'd like, I can attempt to implement it.
I can verify that this modest patch did in fact work in my notebook testing.