Skip to content

Commit 2b25640

Browse files
TYP: remove inappropraite use of cast (#34990)
1 parent a7d96fa commit 2b25640

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pandas/io/formats/format.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -588,15 +588,14 @@ def __init__(
588588
elif isinstance(col_space, (int, str)):
589589
self.col_space = {"": col_space}
590590
self.col_space.update({column: col_space for column in self.frame.columns})
591-
elif isinstance(col_space, dict):
591+
elif isinstance(col_space, Mapping):
592592
for column in col_space.keys():
593593
if column not in self.frame.columns and column != "":
594594
raise ValueError(
595595
f"Col_space is defined for an unknown column: {column}"
596596
)
597597
self.col_space = col_space
598598
else:
599-
col_space = cast(Sequence, col_space)
600599
if len(frame.columns) != len(col_space):
601600
raise ValueError(
602601
f"Col_space length({len(col_space)}) should match "

0 commit comments

Comments
 (0)