@@ -62,8 +62,7 @@ def table_widget(paginated_bf_df: bf.dataframe.DataFrame):
6262 Helper fixture to create a TableWidget instance with a fixed page size.
6363 This reduces duplication across tests that use the same widget configuration.
6464 """
65-
66- from bigframes .display import TableWidget
65+ from bigframes .display .anywidget import TableWidget
6766
6867 with bf .option_context ("display.repr_mode" , "anywidget" , "display.max_rows" , 2 ):
6968 # Delay context manager cleanup of `max_rows` until after tests finish.
@@ -92,7 +91,7 @@ def small_bf_df(
9291@pytest .fixture
9392def small_widget (small_bf_df ):
9493 """Helper fixture for tests using a DataFrame smaller than the page size."""
95- from bigframes .display import TableWidget
94+ from bigframes .display . anywidget import TableWidget
9695
9796 with bf .option_context ("display.repr_mode" , "anywidget" , "display.max_rows" , 5 ):
9897 yield TableWidget (small_bf_df )
@@ -152,10 +151,11 @@ def test_widget_initialization_should_calculate_total_row_count(
152151 paginated_bf_df : bf .dataframe .DataFrame ,
153152):
154153 """A TableWidget should correctly calculate the total row count on creation."""
155- from bigframes .display import TableWidget
154+ from bigframes .display . anywidget import TableWidget
156155
157156 with bf .option_context ("display.repr_mode" , "anywidget" , "display.max_rows" , 2 ):
158157 widget = TableWidget (paginated_bf_df )
158+ widget = TableWidget (paginated_bf_df )
159159
160160 assert widget .row_count == EXPECTED_ROW_COUNT
161161
@@ -266,7 +266,7 @@ def test_widget_pagination_should_work_with_custom_page_size(
266266 A widget should paginate correctly with a custom page size of 3.
267267 """
268268 with bf .option_context ("display.repr_mode" , "anywidget" , "display.max_rows" , 3 ):
269- from bigframes .display import TableWidget
269+ from bigframes .display . anywidget import TableWidget
270270
271271 widget = TableWidget (paginated_bf_df )
272272 assert widget .page_size == 3
@@ -312,7 +312,7 @@ def test_widget_page_size_should_be_immutable_after_creation(
312312 by subsequent changes to global options.
313313 """
314314 with bf .option_context ("display.repr_mode" , "anywidget" , "display.max_rows" , 2 ):
315- from bigframes .display import TableWidget
315+ from bigframes .display . anywidget import TableWidget
316316
317317 widget = TableWidget (paginated_bf_df )
318318 assert widget .page_size == 2
@@ -331,7 +331,7 @@ def test_widget_page_size_should_be_immutable_after_creation(
331331def test_empty_widget_should_have_zero_row_count (empty_bf_df : bf .dataframe .DataFrame ):
332332 """Given an empty DataFrame, the widget's row count should be 0."""
333333 with bf .option_context ("display.repr_mode" , "anywidget" ):
334- from bigframes .display import TableWidget
334+ from bigframes .display . anywidget import TableWidget
335335
336336 widget = TableWidget (empty_bf_df )
337337
@@ -341,7 +341,7 @@ def test_empty_widget_should_have_zero_row_count(empty_bf_df: bf.dataframe.DataF
341341def test_empty_widget_should_render_table_headers (empty_bf_df : bf .dataframe .DataFrame ):
342342 """Given an empty DataFrame, the widget should still render table headers."""
343343 with bf .option_context ("display.repr_mode" , "anywidget" ):
344- from bigframes .display import TableWidget
344+ from bigframes .display . anywidget import TableWidget
345345
346346 widget = TableWidget (empty_bf_df )
347347
@@ -477,10 +477,8 @@ def test_struct_column_anywidget_mode(mock_display, session: bf.Session):
477477 # Assert that we did NOT fall back to the deferred representation.
478478 mock_repr_query_job .assert_not_called ()
479479
480- # Assert that display was called with a TableWidget
481- mock_display .assert_called_once ()
482480 widget = mock_display .call_args [0 ][0 ]
483- from bigframes .display import TableWidget
481+ from bigframes .display . anywidget import TableWidget
484482
485483 assert isinstance (widget , TableWidget )
486484
@@ -518,7 +516,7 @@ def test_json_column_anywidget_mode(mock_display, json_df: bf.dataframe.DataFram
518516 # Assert TableWidget was created and displayed
519517 mock_display .assert_called_once ()
520518 widget = mock_display .call_args [0 ][0 ]
521- from bigframes .display import TableWidget
519+ from bigframes .display . anywidget import TableWidget
522520
523521 assert isinstance (widget , TableWidget )
524522
0 commit comments