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