Skip to content

CLN: remove unused concat code #43577

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 4 commits into from
Sep 15, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix incorrect assertion
  • Loading branch information
jbrockmendel committed Sep 15, 2021
commit 91c310aef3632ccac15172e12658297eeb53a96d
16 changes: 14 additions & 2 deletions pandas/core/internals/concat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import copy
import itertools
from typing import (
TYPE_CHECKING,
Expand Down Expand Up @@ -647,9 +648,20 @@ def _trim_join_unit(join_unit: JoinUnit, length: int) -> JoinUnit:

Extra items that didn't fit are returned as a separate block.
"""
assert 0 not in join_unit.indexers
if 0 not in join_unit.indexers:
extra_indexers = join_unit.indexers

extra_indexers = join_unit.indexers
if join_unit.block is None:
extra_block = None
else:
extra_block = join_unit.block.getitem_block(slice(length, None))
join_unit.block = join_unit.block.getitem_block(slice(length))
else:
extra_block = join_unit.block

extra_indexers = copy.copy(join_unit.indexers)
extra_indexers[0] = extra_indexers[0][length:]
join_unit.indexers[0] = join_unit.indexers[0][:length]

if join_unit.block is None:
extra_block = None
Expand Down