Skip to content

BUG: Raise TypeError for scalar indexer in take #44763

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
Dec 10, 2021

Conversation

gfkang
Copy link
Contributor

@gfkang gfkang commented Dec 5, 2021

Copy link
Member

@phofl phofl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of comments. Also please add whatsnew

@@ -70,6 +70,13 @@ def test_take(self, index):
with pytest.raises(AttributeError, match=msg):
index.freq

def test_take_indexer_type(self):
integer_index = Int64Index([0, 1, 2, 3])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this index constructor is deprecated, please use Index(

@jreback jreback added the Error Reporting Incorrect or improved errors from pandas label Dec 5, 2021
@phofl
Copy link
Member

phofl commented Dec 10, 2021

Could you rebase master? We had a few ci failures

Use pandas is_scalar, remove deprecated constructor, add GH issue number to test
@mroeschke mroeschke added this to the 1.4 milestone Dec 10, 2021
@mroeschke mroeschke merged commit 3ea4638 into pandas-dev:master Dec 10, 2021
@mroeschke
Copy link
Member

Thanks @gfkang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: wrong/confusing error message in DataFrame.take with a scalar indexer
4 participants