Skip to content

Commit

Permalink
fix(python): Fix max_colname_length formatting in glimpse() (#13969)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonthall22 authored Jan 25, 2024
1 parent 165bbda commit da867b7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions py-polars/polars/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -4336,7 +4336,6 @@ def _parse_column(col_name: str, dtype: PolarsDataType) -> tuple[str, str, str]:
# determine column layout widths
max_col_name = max((len(col_name) for col_name, _, _ in data))
max_col_dtype = max((len(dtype_str) for _, dtype_str, _ in data))
max_col_values = 100 - max_col_name - max_col_dtype

# print header
output = StringIO()
Expand All @@ -4347,7 +4346,7 @@ def _parse_column(col_name: str, dtype: PolarsDataType) -> tuple[str, str, str]:
output.write(
f"$ {col_name:<{max_col_name}}"
f" {dtype_str:>{max_col_dtype}}"
f" {val_str:<{min(len(val_str), max_col_values)}}\n"
f" {val_str}\n"
)

s = output.getvalue()
Expand Down

0 comments on commit da867b7

Please sign in to comment.