-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
SDK - Preventing errors when importing kfp.notebook #1215
SDK - Preventing errors when importing kfp.notebook #1215
Conversation
This function is not covered by any tests. Can we add a test for it? |
Hmm. I guess we should test it using sample test the same way we test image building functions. I think we have a sample notebook showing this function. I'll check whether it's covered by sample tests. |
Thanks. |
I've checked and this magic is used in a sample notebook which is covered by sample test. |
@Ark-kun would like to understand more about this functionality - what`s the scope? |
%%docker is just a very thin syntactic sugar over the This PR just stops the file from crashing programs that try to import the package. |
/lgtm |
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.
Could you add a user-friendly message in case of import failure?
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Ark-kun The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1 similar comment
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Ark-kun The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Not having the IPython instance running is not an error now, so there is no error message. |
I mean user-friendly message that there is no magic docker() if there is no IPython. |
I'm not sure how that would work. Can you give a scenario? With this fix, the To be able use a magic (whether a working one or the one raining errors) there needs to be a notebook/IPython running. |
I meant: Something like this to warn the users about the inavailability of the docker command if the IPython is not found. |
But how would the users use that command if they though it's available?
I see no scenario whether the user can actually detect that "the %%docker magic is unavailable". It's Catch-22: The users can only detect the presence of magic when they're in the IPython environment. But in that case the magic is always registered. |
Even though they would not be able to use the docker, it still helps show a message that if they want to use the docker magic, use it in the notebook. |
This change is