Skip to content

CLN/DEPR: remove Block._holder, deprecated Block.is_categorical #40571

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 3 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
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
test is_categorical deprecation warning
  • Loading branch information
jbrockmendel committed Mar 23, 2021
commit 197773abb9e55f46d9654c222b4826e2a04ac491
1 change: 1 addition & 0 deletions pandas/core/internals/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def is_categorical(self) -> bool:
"future version. Use isinstance(block.values, Categorical) "
"instead. See https://github.com/pandas-dev/pandas/issues/40226",
DeprecationWarning,
stacklevel=2,
)
return isinstance(self.values, Categorical)

Expand Down
6 changes: 6 additions & 0 deletions pandas/tests/internals/test_internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,12 @@ def test_split(self):
for res, exp in zip(result, expected):
assert_block_equal(res, exp)

def test_is_categorical_deprecated(self):
# GH#40571
blk = self.fblock
with tm.assert_produces_warning(DeprecationWarning):
blk.is_categorical


class TestBlockManager:
def test_attrs(self):
Expand Down