kosiew commented on code in PR #1367:
URL: 
https://github.com/apache/datafusion-python/pull/1367#discussion_r2767413062


##########
python/tests/test_dataframe.py:
##########
@@ -1458,15 +1458,65 @@ def test_html_formatter_memory(df, 
clean_formatter_state):
     assert "data truncated" not in html_output.lower()
 
 
-def test_html_formatter_repr_rows(df, clean_formatter_state):
-    configure_formatter(min_rows_display=2, repr_rows=2)
+def test_html_formatter_memory_boundary_conditions(df, clean_formatter_state):
+    """Test memory limit behavior at boundary conditions.
+
+    This test validates that the formatter correctly handles edge cases when
+    the memory limit is very close to actual data size, ensuring that min_rows
+    constraint is properly respected while respecting memory limits.
+    """
+
+    # Get the raw size of the data to test boundary conditions
+    # First, capture output with no limits
+    configure_formatter(max_memory_bytes=10 * MB, min_rows_display=1, 
max_rows=100)
+    unrestricted_output = df._repr_html_()
+    unrestricted_rows = count_table_rows(unrestricted_output)
+
+    # Test 1: Very small memory limit should still respect min_rows
+    configure_formatter(max_memory_bytes=10, min_rows_display=1)

Review Comment:
   I'll create tests for early stream termination behavior with multi-batch 
DataFrames.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to