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

Fix notebook env detection logic #36

Merged
merged 3 commits into from
Dec 1, 2023
Merged

Fix notebook env detection logic #36

merged 3 commits into from
Dec 1, 2023

Conversation

rosbo
Copy link
Contributor

@rosbo rosbo commented Nov 30, 2023

Currently, calling kagglehub.login() in a IPython session would try to show a widget and fail: https://screenshot.googleplex.com/9vmyWNKDjymVuny

http://b/314205619

Currently, calling `kagglehub.login()` in a IPython session would try to
show a widget and fail: https://screenshot.googleplex.com/9vmyWNKDjymVuny

http://b/314205619
Copy link

@thkim1011 thkim1011 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@rosbo rosbo merged commit 2f14c25 into main Dec 1, 2023
@rosbo rosbo deleted the fix-notebook-detection branch December 1, 2023 00:03
shell_class = get_ipython().__class__
for parent_class in shell_class.__mro__: # e.g. "is subclass of"
if parent_class.__name__ == "ZMQInteractiveShell":
return True # Jupyter notebook, Kaggle Noteboo, Google colab or qtconsole
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Notebook

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

Successfully merging this pull request may close these issues.

3 participants