8000 refactor: simplify _repr_html_ method in DataFrame to directly call i… · kosiew/datafusion-python@312fd4a · GitHub
[go: up one dir, main page]

Skip to content

Commit 312fd4a

Browse files
committed
refactor: simplify _repr_html_ method in DataFrame to directly call internal representation
1 parent 4db14c0 commit 312fd4a

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

python/datafusion/dataframe.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,7 @@ def __repr__(self) -> str:
152152
return self.df.__repr__()
153153

154154
def _repr_html_(self) -> str:
155-
"""Return HTML representation for Jupyter notebooks."""
156-
# Import here to avoid circular imports
157-
from datafusion.html_formatter import get_formatter
158-
159-
# Always get the latest formatter instance
160-
formatter = get_formatter()
161-
162-
# Get data and schema
163-
batches = self.collect()
164-
schema = self.schema()
165-
166-
# Format the data using our formatter
167-
return formatter.format_html(batches, schema)
155+
return self.df._repr_html_()
168156

169157
def describe(self) -> DataFrame:
170158
"""Return the statistics for this DataFrame.

0 commit comments

Comments
 (0)
0