Skip to content

Commit d40acbe

Browse files
committed
managers: Remove create_block_manager_from_blocks
1 parent f7d1f28 commit d40acbe

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

pandas/core/internals/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
BlockManager,
1919
SingleBlockManager,
2020
create_block_manager_from_arrays,
21-
create_block_manager_from_blocks,
2221
)
2322

2423
__all__ = [
@@ -40,5 +39,4 @@
4039
"concatenate_block_managers",
4140
# those two are preserved here for downstream compatibility (GH-33892)
4241
"create_block_manager_from_arrays",
43-
"create_block_manager_from_blocks",
4442
]

pandas/core/internals/managers.py

-22
Original file line numberDiff line numberDiff line change
@@ -1633,28 +1633,6 @@ def fast_xs(self, loc):
16331633
# Constructor Helpers
16341634

16351635

1636-
def create_block_manager_from_blocks(blocks, axes: List[Index]) -> BlockManager:
1637-
if len(blocks) == 1 and not isinstance(blocks[0], Block):
1638-
# if blocks[0] is of length 0, return empty blocks
1639-
if not len(blocks[0]):
1640-
blocks = []
1641-
else:
1642-
# It's OK if a single block is passed as values, its placement
1643-
# is basically "all items", but if there're many, don't bother
1644-
# converting, it's an error anyway.
1645-
return create_block_manager_from_array(blocks[0], axes)
1646-
1647-
try:
1648-
mgr = BlockManager(blocks, axes)
1649-
mgr._consolidate_inplace()
1650-
return mgr
1651-
1652-
except ValueError as e:
1653-
blocks = [getattr(b, "values", b) for b in blocks]
1654-
tot_items = sum(b.shape[0] for b in blocks)
1655-
raise construction_error(tot_items, blocks[0].shape[1:], axes, e)
1656-
1657-
16581636
def create_block_manager_from_arrays(
16591637
arrays, names: Index, axes: List[Index]
16601638
) -> BlockManager:

0 commit comments

Comments
 (0)