Skip to content

Commit 3cc93f0

Browse files
check_untyped_defs pandas.core.internals.concat
1 parent 6f278d4 commit 3cc93f0

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

pandas/core/internals/concat.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# TODO: Needs a better name; too many modules are already called "concat"
22
from collections import defaultdict
33
import copy
4+
from typing import Dict, List
45

56
import numpy as np
67

@@ -41,10 +42,10 @@ def get_mgr_concatenation_plan(mgr, indexers):
4142
"""
4243
# Calculate post-reindex shape , save for item axis which will be separate
4344
# for each block anyway.
44-
mgr_shape = list(mgr.shape)
45+
mgr_shape_ = list(mgr.shape)
4546
for ax, indexer in indexers.items():
46-
mgr_shape[ax] = len(indexer)
47-
mgr_shape = tuple(mgr_shape)
47+
mgr_shape_[ax] = len(indexer)
48+
mgr_shape = tuple(mgr_shape_)
4849

4950
if 0 in indexers:
5051
ax0_indexer = indexers.pop(0)
@@ -69,9 +70,9 @@ def get_mgr_concatenation_plan(mgr, indexers):
6970

7071
join_unit_indexers = indexers.copy()
7172

72-
shape = list(mgr_shape)
73-
shape[0] = len(placements)
74-
shape = tuple(shape)
73+
shape_ = list(mgr_shape)
74+
shape_[0] = len(placements)
75+
shape = tuple(shape_)
7576

7677
if blkno == -1:
7778
unit = JoinUnit(None, shape)
@@ -300,8 +301,8 @@ def get_empty_dtype_and_na(join_units):
300301
else:
301302
dtypes[i] = unit.dtype
302303

303-
upcast_classes = defaultdict(list)
304-
null_upcast_classes = defaultdict(list)
304+
upcast_classes: Dict[str, List] = defaultdict(list)
305+
null_upcast_classes: Dict[str, List] = defaultdict(list)
305306
for dtype, unit in zip(dtypes, join_units):
306307
if dtype is None:
307308
continue

setup.cfg

-3
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,6 @@ check_untyped_defs=False
218218
[mypy-pandas.core.internals.blocks]
219219
check_untyped_defs=False
220220

221-
[mypy-pandas.core.internals.concat]
222-
check_untyped_defs=False
223-
224221
[mypy-pandas.core.internals.construction]
225222
check_untyped_defs=False
226223

0 commit comments

Comments
 (0)