We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 907aef5 commit 72bc9adCopy full SHA for 72bc9ad
python/datafusion/dataframe.py
@@ -149,14 +149,15 @@ def __repr__(self) -> str:
149
Returns:
150
String representation of the DataFrame.
151
"""
152
- # Check if we're in IPython/Jupyter. If so, we will only use
+ # Check if we're in a Jupyter notebook. If so, we will only use
153
# the _repr_html_ output to avoid calling collect() twice.
154
try:
155
from IPython import get_ipython
156
157
- if get_ipython() is not None:
+ shell = get_ipython().__class__.__name__
158
+ if shell == "ZMQInteractiveShell":
159
return "" # Return empty string to effectively disable
- except ImportError:
160
+ except (ImportError, NameError):
161
pass
162
163
return self.df.__repr__()
0 commit comments