Skip to content

BUG: fix StringArray/PandasArray setitem with slice #31773

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
Feb 12, 2020

Conversation

jorisvandenbossche
Copy link
Member

Closes #31772

@jorisvandenbossche jorisvandenbossche added Bug Indexing Related to indexing on series/frames, not to indexes themselves labels Feb 7, 2020
@jorisvandenbossche jorisvandenbossche added this to the 1.0.2 milestone Feb 7, 2020
scalar_value = lib.is_scalar(value)

if not scalar_key and scalar_value:
key = np.asarray(key)
Copy link
Member Author

Choose a reason for hiding this comment

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

@TomAugspurger do you remember why this was needed?
(I can also do a and not isinstance(key, slice) to be more conservative, but can't directly come up with a reason to keep it)

Copy link
Contributor

Choose a reason for hiding this comment

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

I don’t recall.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

can you also add the test you had in the OP, e.g. the .loc on a frame.

@jreback jreback merged commit 361a938 into pandas-dev:master Feb 12, 2020
@jreback
Copy link
Contributor

jreback commented Feb 12, 2020

thanks!

@jorisvandenbossche
Copy link
Member Author

@meeseeksdev backport to 1.0.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: setitem on string dtype with slices fails
4 participants