-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG/TST: PeriodArray.__setitem__ with slice and list-like value #23991
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
Changes from 11 commits
4385128
aacb769
e19c381
b12f0bc
6ca1f1a
f3db6c1
fe74ea1
0e19fdb
3e76a61
ec8f68e
217146f
74ea7b8
39a4807
6c9702e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
import pandas as pd | ||
from pandas.core.arrays import PeriodArray | ||
from pandas.tests.extension import base | ||
import pandas.util.testing as tm | ||
|
||
|
||
@pytest.fixture | ||
|
@@ -147,7 +148,16 @@ class TestReshaping(BasePeriodTests, base.BaseReshapingTests): | |
|
||
|
||
class TestSetitem(BasePeriodTests, base.BaseSetitemTests): | ||
pass | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And this. |
||
def test_setitem_slice_mismatch_length_raises(self, data): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh, just noticed. This should be on the base class BaseSetitemTests. Then all the subclasses will be tested, including period. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same for the other test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ahh, i see, yeah, makes sense!! thx! |
||
arr = data[:5] | ||
with pytest.raises(ValueError): | ||
arr[:1] = arr[:2] | ||
|
||
def test_setitem_slice_array(self, data): | ||
arr = data[:5].copy() | ||
arr[:5] = data[-5:] | ||
tm.assert_extension_array_equal(arr, data[-5:]) | ||
|
||
|
||
class TestGroupby(BasePeriodTests, base.BaseGroupbyTests): | ||
|
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.
Probably delete this