Skip to content

Commit 3eef165

Browse files
authored
TYP: some typing in internals/concat.py (#52581)
* TYP: some typing in internals/concat.py * add add
1 parent 66ddd5e commit 3eef165

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pandas/_libs/internals.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class BlockPlacement:
5353
def __iter__(self) -> Iterator[int]: ...
5454
def __len__(self) -> int: ...
5555
def delete(self, loc) -> BlockPlacement: ...
56+
def add(self, other) -> BlockPlacement: ...
5657
def append(self, others: list[BlockPlacement]) -> BlockPlacement: ...
5758
def tile_for_unstack(self, factor: int) -> npt.NDArray[np.intp]: ...
5859

pandas/core/internals/concat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,10 @@ def _concat_managers_axis0(
265265
}
266266
mgrs_indexers = _maybe_reindex_columns_na_proxy(axes, mgrs_indexers)
267267

268-
mgrs = [x[0] for x in mgrs_indexers]
268+
mgrs: list[BlockManager] = [x[0] for x in mgrs_indexers]
269269

270270
offset = 0
271-
blocks = []
271+
blocks: list[Block] = []
272272
for i, mgr in enumerate(mgrs):
273273
# If we already reindexed, then we definitely don't need another copy
274274
made_copy = had_reindexers[i]
@@ -341,7 +341,7 @@ def _get_mgr_concatenation_plan(
341341
blknos = mgr.blknos
342342
blklocs = mgr.blklocs
343343

344-
plan = []
344+
plan: list[tuple[BlockPlacement, JoinUnit]] = []
345345
for blkno, placements in libinternals.get_blkno_placements(blknos, group=False):
346346
assert placements.is_slice_like
347347
assert blkno != -1

0 commit comments

Comments
 (0)