@@ -62,11 +62,11 @@ 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- from bigframes import display
65+ from bigframes . display . anywidget import TableWidget
6666
6767 with bf .option_context ("display.repr_mode" , "anywidget" , "display.max_rows" , 2 ):
6868 # Delay context manager cleanup of `max_rows` until after tests finish.
69- yield display . TableWidget (paginated_bf_df )
69+ yield TableWidget (paginated_bf_df )
7070
7171
7272@pytest .fixture (scope = "module" )
@@ -91,10 +91,10 @@ def small_bf_df(
9191@pytest .fixture
9292def small_widget (small_bf_df ):
9393 """Helper fixture for tests using a DataFrame smaller than the page size."""
94- from bigframes import display
94+ from bigframes . display . anywidget import TableWidget
9595
9696 with bf .option_context ("display.repr_mode" , "anywidget" , "display.max_rows" , 5 ):
97- yield display . TableWidget (small_bf_df )
97+ yield TableWidget (small_bf_df )
9898
9999
100100@pytest .fixture (scope = "module" )
@@ -151,10 +151,10 @@ def test_widget_initialization_should_calculate_total_row_count(
151151 paginated_bf_df : bf .dataframe .DataFrame ,
152152):
153153 """A TableWidget should correctly calculate the total row count on creation."""
154- from bigframes import display
154+ from bigframes . display . anywidget import TableWidget
155155
156156 with bf .option_context ("display.repr_mode" , "anywidget" , "display.max_rows" , 2 ):
157- widget = display . TableWidget (paginated_bf_df )
157+ widget = TableWidget (paginated_bf_df )
158158
159159 assert widget .row_count == EXPECTED_ROW_COUNT
160160
@@ -265,7 +265,7 @@ def test_widget_pagination_should_work_with_custom_page_size(
265265 A widget should paginate correctly with a custom page size of 3.
266266 """
267267 with bf .option_context ("display.repr_mode" , "anywidget" , "display.max_rows" , 3 ):
268- from bigframes .display import TableWidget
268+ from bigframes .display . anywidget import TableWidget
269269
270270 widget = TableWidget (paginated_bf_df )
271271 assert widget .page_size == 3
@@ -311,7 +311,7 @@ def test_widget_page_size_should_be_immutable_after_creation(
311311 by subsequent changes to global options.
312312 """
313313 with bf .option_context ("display.repr_mode" , "anywidget" , "display.max_rows" , 2 ):
314- from bigframes .display import TableWidget
314+ from bigframes .display . anywidget import TableWidget
315315
316316 widget = TableWidget (paginated_bf_df )
317317 assert widget .page_size == 2
@@ -330,7 +330,7 @@ def test_widget_page_size_should_be_immutable_after_creation(
330330def test_empty_widget_should_have_zero_row_count (empty_bf_df : bf .dataframe .DataFrame ):
331331 """Given an empty DataFrame, the widget's row count should be 0."""
332332 with bf .option_context ("display.repr_mode" , "anywidget" ):
333- from bigframes .display import TableWidget
333+ from bigframes .display . anywidget import TableWidget
334334
335335 widget = TableWidget (empty_bf_df )
336336
@@ -340,7 +340,7 @@ def test_empty_widget_should_have_zero_row_count(empty_bf_df: bf.dataframe.DataF
340340def test_empty_widget_should_render_table_headers (empty_bf_df : bf .dataframe .DataFrame ):
341341 """Given an empty DataFrame, the widget should still render table headers."""
342342 with bf .option_context ("display.repr_mode" , "anywidget" ):
343- from bigframes .display import TableWidget
343+ from bigframes .display . anywidget import TableWidget
344344
345345 widget = TableWidget (empty_bf_df )
346346
@@ -476,10 +476,8 @@ def test_struct_column_anywidget_mode(mock_display, session: bf.Session):
476476 # Assert that we did NOT fall back to the deferred representation.
477477 mock_repr_query_job .assert_not_called ()
478478
479- # Assert that display was called with a TableWidget
480- mock_display .assert_called_once ()
481479 widget = mock_display .call_args [0 ][0 ]
482- from bigframes .display import TableWidget
480+ from bigframes .display . anywidget import TableWidget
483481
484482 assert isinstance (widget , TableWidget )
485483
@@ -517,7 +515,7 @@ def test_json_column_anywidget_mode(mock_display, json_df: bf.dataframe.DataFram
517515 # Assert TableWidget was created and displayed
518516 mock_display .assert_called_once ()
519517 widget = mock_display .call_args [0 ][0 ]
520- from bigframes .display import TableWidget
518+ from bigframes .display . anywidget import TableWidget
521519
522520 assert isinstance (widget , TableWidget )
523521
0 commit comments