Skip to content

Put create_manager_from_blocks in internals.api #55575

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
Oct 18, 2023
Merged
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
22 changes: 22 additions & 0 deletions pandas/core/internals/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,25 @@ def maybe_infer_ndim(values, placement: BlockPlacement, ndim: int | None) -> int
else:
ndim = values.ndim
return ndim


def __getattr__(name: str):
import warnings

from pandas.util._exceptions import find_stack_level

if name == "create_block_manager_from_blocks":
# GH#33892
warnings.warn(
f"{name} is deprecated and will be removed in a future version. "
"Use public APIs instead.",
DeprecationWarning,
stacklevel=find_stack_level(),
)
from pandas.core.internals.managers import create_block_manager_from_blocks

return create_block_manager_from_blocks

raise AttributeError(
f"module 'pandas.core.internals.api' has no attribute '{name}'"
)