File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -4531,7 +4531,7 @@ def set_backend(
45314531 max_shape_str = f"({ max_rows :.0g} , { max_cols :.0g} )"
45324532 desc = (
45334533 f"Transfer: { self_backend_str :>10.10} → { normalized_backend_str :<10.10} "
4534- + f" | { operation_str :^15.15} ≃ { max_shape_str :<10.10 } "
4534+ + f" | { operation_str :^15.15} ≃ { max_shape_str } "
45354535 )
45364536
45374537 if ShowBackendSwitchProgress .get ():
Original file line number Diff line number Diff line change @@ -447,6 +447,20 @@ def test_fallback_progress_printing(
447447 assert captured .out == "" # Nothing should go to stdout
448448
449449
450+ @config_context (Backend = "python_test" )
451+ def test_bigger_df_progress_message ():
452+ # Insiginificant digits in the size get truncated
453+ df = pd .DataFrame ([[1 ] * 144 ] * 121 )
454+ with patch .object (tqdm .auto , "trange" , return_value = range (2 )) as mock_trange :
455+ df .set_backend ("pandas" )
456+ mock_trange .assert_called_once ()
457+ call_args = mock_trange .call_args
458+ desc = call_args [1 ]["desc" ] # Get the 'desc' keyword argument
459+ assert desc .startswith (
460+ "Transfer: Python_... → Pandas | ≃ (1e+02, 1e+02)"
461+ )
462+
463+
450464@patch ("tqdm.auto.trange" , side_effect = ImportError ("tqdm not available" ))
451465@config_context (Backend = "python_test" )
452466def test_fallback_progress_printing_silent_when_disabled (mock_trange , capsys ):
You can’t perform that action at this time.
0 commit comments