Skip to content

Commit 89f1854

Browse files
committed
Use asymtopic equals and use "Transfer" instead of "Transferring"
1 parent b40bbcd commit 89f1854

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

modin/pandas/base.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4508,15 +4508,30 @@ def set_backend(
45084508
# Format the transfer string to be relatively short, but informative. Each
45094509
# backend is given an allowable width of 10 and the shape integers use the
45104510
# general format to use scientific notation when needed.
4511+
std_field_length = 10
45114512
operation_str = switch_operation
4513+
self_backend_str = self_backend
4514+
normalized_backend_str = normalized_backend
45124515
if switch_operation is None:
45134516
operation_str = ""
45144517
# Provide the switch_operation; and specifically only the method, so
45154518
# DataFrame.merge would become "merge"
4516-
max_shape_str = f"({max_rows:.0g},{max_cols:.0g})"
4519+
operation_str = operation_str.split(".")[-1]
4520+
# truncate all strings to the field length if needed
4521+
if len(operation_str) > 15:
4522+
operation_str = operation_str[: 15 - 3] + "..."
4523+
if len(self_backend_str) > std_field_length:
4524+
self_backend_str = self_backend_str[: std_field_length - 3] + "..."
4525+
if len(normalized_backend_str) > std_field_length:
4526+
normalized_backend_str = (
4527+
normalized_backend_str[: std_field_length - 3] + "..."
4528+
)
4529+
4530+
# format the estimated max shape
4531+
max_shape_str = f"({max_rows:.0g}, {max_cols:.0g})"
45174532
desc = (
4518-
f"Transferring: {self_backend:>10.10}{normalized_backend:<10.10} "
4519-
+ f" | {operation_str.split('.')[-1]:^10.10} | est. max shape {max_shape_str:<13.13}"
4533+
f"Transfer: {self_backend_str:>10.10}{normalized_backend_str:<10.10} "
4534+
+ f" | {operation_str:^15.15}{max_shape_str:<10.10}"
45204535
)
45214536

45224537
if ShowBackendSwitchProgress.get():

modin/tests/pandas/native_df_interoperability/test_compiler_caster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ def test_progress_bar_shows_modin_pandas_for_general_functions(self):
857857
desc = call_args[1]["desc"] # Get the 'desc' keyword argument
858858

859859
assert desc.startswith(
860-
"Transferring: Big_Data_CSmall_Data | read_json | est. max shape (9,1) "
860+
"Transfer: Big_Dat...Small_D... | read_json ≃ (9, 1) "
861861
)
862862

863863
def test_agg(self):

modin/tests/pandas/test_backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,11 @@ def do_groupby(series):
424424
[
425425
(
426426
None,
427-
"Transferring: Python_Tes → Pandas | | est. max shape (3,1) ",
427+
"Transfer: Python_... → Pandas | (3, 1) ",
428428
),
429429
(
430430
"test_operation",
431-
"Transferring: Python_Tes → Pandas | test_opera | est. max shape (3,1) ",
431+
"Transfer: Python_... → Pandas | test_operation ≃ (3, 1) ",
432432
),
433433
],
434434
)

0 commit comments

Comments
 (0)