File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,34 +126,3 @@ def str_lit(value):
126126def lit (value ) -> Expr :
127127 """Create a literal expression."""
128128 return Expr .literal (value )
129-
130-
131- # Apply monkeypatch for DataFrame._repr_html_ to properly use our HTML formatter
132- def _patch_dataframe_repr_html ():
133- """Apply patch to DataFrame._repr_html_ to use our HTML formatter."""
134- try :
135- from datafusion .dataframe import DataFrame
136- from datafusion .html_formatter import get_formatter
137-
138- # Store original method if needed
139- if not hasattr (DataFrame , "_original_repr_html_" ):
140- DataFrame ._original_repr_html_ = DataFrame ._repr_html_
141-
142- # Define patched method
143- def patched_repr_html (self ):
144- """Return HTML representation using configured formatter."""
145- from datafusion .html_formatter import get_formatter
146-
147- formatter = get_formatter ()
148- batches = self .collect ()
149- schema = self .schema ()
150- return formatter .format_html (batches , schema )
151-
152- # Apply the patch
153- DataFrame ._repr_html_ = patched_repr_html
154- except (ImportError , AttributeError ) as e :
155- print (f"Warning: Could not patch DataFrame._repr_html_: { e } " )
156-
157-
158- # Apply the patch when module is imported
159- _patch_dataframe_repr_html ()
You can’t perform that action at this time.
0 commit comments