Skip to content

Commit 1c6e189

Browse files
committed
refactor: remove redundant imports and debug print statements in HTML formatter tests
1 parent a7a2a9c commit 1c6e189

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

python/tests/test_dataframe.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from datafusion.html_formatter import (
3636
_default_formatter,
3737
configure_formatter,
38+
get_formatter,
3839
)
3940
from pyarrow.csv import write_csv
4041

@@ -717,7 +718,6 @@ def get_header_style(self) -> str:
717718

718719
def test_html_formatter_type_formatters(df, reset_formatter):
719720
"""Test registering custom type formatters for specific data types."""
720-
from datafusion.html_formatter import get_formatter
721721

722722
# Get current formatter and register custom formatters
723723
formatter = get_formatter()
@@ -731,15 +731,13 @@ def format_int(value):
731731
formatter.register_formatter(int, format_int)
732732

733733
html_output = df._repr_html_()
734-
print(f"HTML output contains {len(html_output)} characters")
735734

736735
# Our test dataframe has values 1,2,3 so we should see:
737736
assert '<span style="color: blue">1</span>' in html_output
738737

739738

740739
def test_html_formatter_custom_cell_builder(df, reset_formatter):
741740
"""Test using a custom cell builder function."""
742-
from datafusion.html_formatter import get_formatter
743741

744742
# Create a custom cell builder that changes background color based on value
745743
def custom_cell_builder(value, row, col, table_id):
@@ -768,7 +766,6 @@ def custom_cell_builder(value, row, col, table_id):
768766

769767
def test_html_formatter_custom_header_builder(df, reset_formatter):
770768
"""Test using a custom header builder function."""
771-
from datafusion.html_formatter import get_formatter
772769

773770
# Create a custom header builder with tooltips
774771
def custom_header_builder(field):
@@ -797,10 +794,6 @@ def custom_header_builder(field):
797794

798795
def test_html_formatter_complex_customization(df, reset_formatter):
799796
"""Test combining multiple customization options together."""
800-
from datafusion.html_formatter import (
801-
configure_formatter,
802-
get_formatter,
803-
)
804797

805798
# Create a dark mode style provider
806799
class DarkModeStyleProvider:

0 commit comments

Comments
 (0)