diff --git a/src/daft-core/src/schema.rs b/src/daft-core/src/schema.rs index 4d44c9cea1..04248d9774 100644 --- a/src/daft-core/src/schema.rs +++ b/src/daft-core/src/schema.rs @@ -124,7 +124,9 @@ impl Schema { res.push_str(""); for (name, field) in &self.fields { - res.push_str(""); + res.push_str( + "", + ); res.push_str(&html_escape::encode_text(name)); res.push_str("
"); res.push_str(&html_escape::encode_text(&format!("{}", field.dtype))); diff --git a/src/daft-table/src/lib.rs b/src/daft-table/src/lib.rs index 8cb07cf971..0dcd16544c 100644 --- a/src/daft-table/src/lib.rs +++ b/src/daft-table/src/lib.rs @@ -457,7 +457,9 @@ impl Table { res.push_str(""); for (name, field) in &self.schema.fields { - res.push_str(""); + res.push_str( + "", + ); res.push_str(&html_escape::encode_text(name)); res.push_str("
"); res.push_str(&html_escape::encode_text(&format!("{}", field.dtype))); diff --git a/tests/dataframe/test_repr.py b/tests/dataframe/test_repr.py index 7b89f1a276..f84e13c0e7 100644 --- a/tests/dataframe/test_repr.py +++ b/tests/dataframe/test_repr.py @@ -14,6 +14,7 @@ UNMATERIALIZED_REGEX = re.compile(r".*\(No data to display: Dataframe not materialized\).*") MATERIALIZED_NO_ROWS_REGEX = re.compile(r".*\(No data to display: Materialized dataframe has no rows\).*") TD_STYLE = 'style="text-align:left; max-width:192px; max-height:64px; overflow:auto"' +TH_STYLE = 'style="text-wrap: nowrap; max-width:192px; overflow:auto; text-align:left"' def parse_str_table( @@ -93,9 +94,9 @@ def test_empty_df_repr(make_df): assert parse_str_table(df.__repr__(), expected_user_msg_regex=UNMATERIALIZED_REGEX) == expected_data assert ( df._repr_html_() - == """
+ == f"""
- +
A
Int64
B
Utf8
A
Int64
B
Utf8
(No data to display: Dataframe not materialized)
""" @@ -115,9 +116,9 @@ def test_empty_df_repr(make_df): assert parse_str_table(df.__repr__(), expected_user_msg_regex=MATERIALIZED_NO_ROWS_REGEX) == expected_data assert ( df._repr_html_() - == """
+ == f"""
- +
A
Int64
B
Utf8
A
Int64
B
Utf8
@@ -134,9 +135,9 @@ def test_alias_repr(make_df): assert parse_str_table(df.__repr__(), expected_user_msg_regex=UNMATERIALIZED_REGEX) == expected_data assert ( df._repr_html_() - == """
+ == f"""
- +
A2
Int64
B
Utf8
A2
Int64
B
Utf8
(No data to display: Dataframe not materialized)
""" @@ -162,7 +163,7 @@ def test_alias_repr(make_df): df._repr_html_() == f"""
- + @@ -189,15 +190,15 @@ def test_repr_with_unicode(make_df, data_source): } string_array = ["🔥a", "b🔥", "🦁🔥" * 60] # we dont truncate for html - expected_html_unmaterialized = """
+ expected_html_unmaterialized = f"""
A2
Int64
B
Utf8
A2
Int64
B
Utf8
1
a
2
b
- +
🔥
Int64
🦁
Utf8
🔥
Int64
🦁
Utf8
(No data to display: Dataframe not materialized)
""" expected_html_materialized = f"""
- +
🔥
Int64
🦁
Utf8
🔥
Int64
🦁
Utf8
1
{string_array[0]}
2
{string_array[1]}