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