Skip to content

Commit d1c0609

Browse files
mypy fixes
1 parent 4dfb4b7 commit d1c0609

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/core/frame.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8569,13 +8569,13 @@ class _IterableExceptStringOrBytes(metaclass=_IterableExceptStringOrBytesMeta):
85698569
pass
85708570

85718571

8572-
@create_block_manager.register
8573-
def _create_block_manager_iterable(
8574-
data: _IterableExceptStringOrBytes, df, index, columns, dtype, copy
8575-
):
8572+
@create_block_manager.register(_IterableExceptStringOrBytes)
8573+
def _create_block_manager_iterable(data: abc.Iterable, df, index, columns, dtype, copy):
85768574
if not isinstance(data, (abc.Sequence, ExtensionArray)):
85778575
data = list(data)
85788576
if len(data) > 0:
8577+
# Need this to tell MyPy the proper type
8578+
data = cast(Union[list, abc.Sequence, ExtensionArray], data)
85798579
if is_dataclass(data[0]):
85808580
data = dataclasses_to_dicts(data)
85818581
if is_list_like(data[0]) and getattr(data[0], "ndim", 1) == 1:

0 commit comments

Comments
 (0)