We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1391078 commit 907aef5Copy full SHA for 907aef5
1 file changed
python/datafusion/dataframe.py
@@ -149,6 +149,16 @@ 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
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:
158
+ return "" # Return empty string to effectively disable
159
+ except ImportError:
160
+ pass
161
162
return self.df.__repr__()
163
164
def _repr_html_(self) -> str:
0 commit comments