Skip to content

TYP: check_untyped_defs core.internals.concat #36008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions pandas/core/internals/concat.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from collections import defaultdict
import copy
from typing import List
from typing import Dict, List

import numpy as np

from pandas._libs import NaT, internals as libinternals
from pandas._typing import DtypeObj
from pandas.util._decorators import cache_readonly

from pandas.core.dtypes.cast import maybe_promote
Expand Down Expand Up @@ -100,10 +101,10 @@ def _get_mgr_concatenation_plan(mgr, indexers):
"""
# Calculate post-reindex shape , save for item axis which will be separate
# for each block anyway.
mgr_shape = list(mgr.shape)
mgr_shape_list = list(mgr.shape)
for ax, indexer in indexers.items():
mgr_shape[ax] = len(indexer)
mgr_shape = tuple(mgr_shape)
mgr_shape_list[ax] = len(indexer)
mgr_shape = tuple(mgr_shape_list)

if 0 in indexers:
ax0_indexer = indexers.pop(0)
Expand All @@ -126,9 +127,9 @@ def _get_mgr_concatenation_plan(mgr, indexers):

join_unit_indexers = indexers.copy()

shape = list(mgr_shape)
shape[0] = len(placements)
shape = tuple(shape)
shape_list = list(mgr_shape)
shape_list[0] = len(placements)
shape = tuple(shape_list)

if blkno == -1:
unit = JoinUnit(None, shape)
Expand Down Expand Up @@ -374,8 +375,8 @@ def _get_empty_dtype_and_na(join_units):
else:
dtypes[i] = unit.dtype

upcast_classes = defaultdict(list)
null_upcast_classes = defaultdict(list)
upcast_classes: Dict[str, List[DtypeObj]] = defaultdict(list)
null_upcast_classes: Dict[str, List[DtypeObj]] = defaultdict(list)
for dtype, unit in zip(dtypes, join_units):
if dtype is None:
continue
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,6 @@ check_untyped_defs=False
[mypy-pandas.core.internals.blocks]
check_untyped_defs=False

[mypy-pandas.core.internals.concat]
check_untyped_defs=False

[mypy-pandas.core.internals.construction]
check_untyped_defs=False

Expand Down