1
1
# TODO: Needs a better name; too many modules are already called "concat"
2
2
from collections import defaultdict
3
3
import copy
4
+ from typing import Dict , List
4
5
5
6
import numpy as np
6
7
@@ -41,10 +42,10 @@ def get_mgr_concatenation_plan(mgr, indexers):
41
42
"""
42
43
# Calculate post-reindex shape , save for item axis which will be separate
43
44
# for each block anyway.
44
- mgr_shape = list (mgr .shape )
45
+ mgr_shape_ = list (mgr .shape )
45
46
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_ )
48
49
49
50
if 0 in indexers :
50
51
ax0_indexer = indexers .pop (0 )
@@ -69,9 +70,9 @@ def get_mgr_concatenation_plan(mgr, indexers):
69
70
70
71
join_unit_indexers = indexers .copy ()
71
72
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_ )
75
76
76
77
if blkno == - 1 :
77
78
unit = JoinUnit (None , shape )
@@ -300,8 +301,8 @@ def get_empty_dtype_and_na(join_units):
300
301
else :
301
302
dtypes [i ] = unit .dtype
302
303
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 )
305
306
for dtype , unit in zip (dtypes , join_units ):
306
307
if dtype is None :
307
308
continue
0 commit comments