@@ -1367,9 +1367,9 @@ def test_min_table_rows_display(ctx):
13671367 row_count = html_output .count ("<tr>" ) - 1 # subtract 1 for the header row
13681368
13691369 # Verify at least min_table_rows rows are displayed
1370- assert (
1371- row_count >= custom_min_rows
1372- ), f"Expected at least { custom_min_rows } rows, got { row_count } "
1370+ assert row_count >= custom_min_rows , (
1371+ f"Expected at least { custom_min_rows } rows, got { row_count } "
1372+ )
13731373
13741374 # If data was truncated, "Data truncated" message should be present
13751375 if row_count < rows :
@@ -1542,63 +1542,3 @@ def test_max_table_rows_in_repr(ctx):
15421542 # Should show all rows (20)
15431543 assert lines_all == rows
15441544 assert "Data truncated" not in repr_str_all
1545-
1546-
1547- def test_session_context_display_config (ctx ):
1548- """Test that display configuration is shared at session context level."""
1549- # Create two dataframes from the same context
1550- batch1 = pa .RecordBatch .from_arrays (
1551- [pa .array ([1 , 2 , 3 ]), pa .array ([4 , 5 , 6 ])],
1552- names = ["a" , "b" ],
1553- )
1554- df1 = ctx .create_dataframe ([[batch1 ]])
1555-
1556- batch2 = pa .RecordBatch .from_arrays (
1557- [pa .array ([7 , 8 , 9 ]), pa .array ([10 , 11 , 12 ])],
1558- names = ["c" , "d" ],
1559- )
1560- df2 = ctx .create_dataframe ([[batch2 ]])
1561-
1562- # Set display config on first dataframe
1563- custom_max_rows = 25
1564- df1 .configure_display (max_table_rows_in_repr = custom_max_rows )
1565-
1566- # Check that both dataframes have the same config
1567- assert df1 .display_config .max_table_rows_in_repr == custom_max_rows
1568- assert df2 .display_config .max_table_rows_in_repr == custom_max_rows
1569-
1570- # Change config on second dataframe
1571- df2 .configure_display (max_cell_length = 40 )
1572-
1573- # Both dataframes should reflect the change
1574- assert df1 .display_config .max_cell_length == 40
1575- assert df2 .display_config .max_cell_length == 40
1576-
1577-
1578- def test_session_context_display_config_independence (ctx ):
1579- """Test that display configurations in different contexts are independent."""
1580- # Create two contexts with different configurations
1581- ctx1 = SessionContext ()
1582- ctx2 = SessionContext ()
1583-
1584- # Create dataframes from each context
1585- batch = pa .RecordBatch .from_arrays (
1586- [pa .array ([1 , 2 , 3 ]), pa .array ([4 , 5 , 6 ])],
1587- names = ["a" , "b" ],
1588- )
1589- df1 = ctx1 .create_dataframe ([[batch ]])
1590- df2 = ctx2 .create_dataframe ([[batch ]])
1591-
1592- # Set different display configurations
1593- df1 .configure_display (max_table_rows_in_repr = 15 )
1594- df2 .configure_display (max_table_rows_in_repr = 30 )
1595-
1596- # Verify configurations are independent
1597- assert df1 .display_config .max_table_rows_in_repr == 15
1598- assert df2 .display_config .max_table_rows_in_repr == 30
1599-
1600- # Create another dataframe from first context
1601- df3 = ctx1 .create_dataframe ([[batch ]])
1602-
1603- # It should have the same config as the first dataframe
1604- assert df3 .display_config .max_table_rows_in_repr == 15
0 commit comments