-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Fixing shift() for ExtensionArray #23947
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 1 commit
7ff05e7
532436e
6584dca
abba682
172545a
67c268d
b0c13e4
acecc2a
e5b7ebc
eb4eea9
d659404
31a9cc8
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import numpy as np | ||
import pytest | ||
|
||
from pandas.compat import StringIO | ||
|
||
|
@@ -86,3 +87,16 @@ def test_isna_extension_array(self, data_missing): | |
assert not na.all() | ||
|
||
assert na.dtype._is_boolean | ||
|
||
@pytest.mark.parametrize('periods, indices', [ | ||
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. I would move this to methods.py I think (and obviously move the overrides in arrow as well) 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. Since moving this to methods takes it out of the 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. see my comment below |
||
[-4, [-1, -1]], | ||
[-1, [1, -1]], | ||
[0, [0, 1]], | ||
[1, [-1, 0]], | ||
[4, [-1, -1]] | ||
]) | ||
def test_shift(self, data, periods, indices): | ||
subset = data[:2] | ||
result = subset.shift(periods) | ||
expected = subset.take(indices, allow_fill=True) | ||
self.assert_extension_array_equal(result, expected) |
Uh oh!
There was an error while loading. Please reload this page.