We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 03921d9 commit 1c80dcdCopy full SHA for 1c80dcd
1 file changed
python/datafusion/dataframe.py
@@ -321,6 +321,16 @@ 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
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:
330
+ return "" # Return empty string to effectively disable
331
+ except ImportError:
332
+ pass
333
334
return self.df.__repr__()
335
336
def _repr_html_(self) -> str:
0 commit comments