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 1c80dcd commit 00a2bb4Copy full SHA for 00a2bb4
python/datafusion/dataframe.py
@@ -321,14 +321,15 @@ def __repr__(self) -> str:
321
Returns:
322
String representation of the DataFrame.
323
"""
324
- # 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
325
# the _repr_html_ output to avoid calling collect() twice.
326
try:
327
from IPython import get_ipython
328
329
- if get_ipython() is not None:
+ shell = get_ipython().__class__.__name__
330
+ if shell == "ZMQInteractiveShell":
331
return "" # Return empty string to effectively disable
- except ImportError:
332
+ except (ImportError, NameError):
333
pass
334
335
return self.df.__repr__()
0 commit comments