-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REGR: DataFrame.__setitem__(slice, val) is positional #31515
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Is this a behavior we want to deprecate and change in the future? Or was the original change unintentional?
The change that this reverts was unintentional (was a code-cleanup intended to remove accessing a private |
Co-Authored-By: Joris Van den Bossche <[email protected]>
OK, will need a followup issue for that deprecation if you want to push for it. Let's give @jreback a chance to look, but this should be good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, surprised we didn’t have a test for this; may want to add some additional cases (eg closed slice in right, open on left and closed on right) - basically the other slice cases
@@ -860,6 +860,15 @@ def test_fancy_getitem_slice_mixed(self, float_frame, float_string_frame): | |||
|
|||
assert (float_frame["C"] == 4).all() | |||
|
|||
def test_setitem_slice_position(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jbrockmendel if you can also test (df[:4]) for example (can just target master is ok)
This still needs a backport? |
@meeseeksdev backport to 1.0.x |
…onal (#31618) Co-authored-by: jbrockmendel <[email protected]> Co-authored-by: Joris Van den Bossche <[email protected]>
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff