Skip to content

Commit

Permalink
Don't set column format
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrumiller committed Jul 23, 2024
1 parent 522610a commit 038c66d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions py-polars/polars/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3223,19 +3223,16 @@ def write_excel(

for column in df.columns:
col_idx, options = table_start[1] + df.get_column_index(column), {}
fmt = column_formats.get(column)
if column in hidden_columns:
options = {"hidden": True}
if column in column_widths: # type: ignore[operator]
ws.set_column_pixels(
col_idx,
col_idx,
column_widths[column], # type: ignore[index]
fmt,
None,
options,
)
elif options or fmt:
ws.set_column(col_idx, col_idx, None, fmt, options)

# finally, inject any sparklines into the table
for column, params in (sparklines or {}).items():
Expand Down

0 comments on commit 038c66d

Please sign in to comment.