Skip to content

Commit

Permalink
TYP: --disallow-any-generics pandas\core\reshape\concat.py (#30658)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins authored and WillAyd committed Jan 4, 2020
1 parent c1b8573 commit 984a2ca
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions pandas/core/reshape/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
concat routines
"""

from typing import List
from typing import Hashable, List, Optional

import numpy as np

Expand Down Expand Up @@ -474,15 +474,10 @@ def _get_result_dim(self) -> int:

def _get_new_axes(self) -> List[Index]:
ndim = self._get_result_dim()
new_axes: List = [None] * ndim

for i in range(ndim):
if i == self.axis:
continue
new_axes[i] = self._get_comb_axis(i)

new_axes[self.axis] = self._get_concat_axis()
return new_axes
return [
self._get_concat_axis() if i == self.axis else self._get_comb_axis(i)
for i in range(ndim)
]

def _get_comb_axis(self, i: int) -> Index:
data_axis = self.objs[0]._get_block_manager_axis(i)
Expand All @@ -501,7 +496,7 @@ def _get_concat_axis(self) -> Index:
idx = ibase.default_index(len(self.objs))
return idx
elif self.keys is None:
names: List = [None] * len(self.objs)
names: List[Optional[Hashable]] = [None] * len(self.objs)
num = 0
has_names = False
for i, x in enumerate(self.objs):
Expand Down

0 comments on commit 984a2ca

Please sign in to comment.