-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Ensure conversion to "native" types for integer EA #31328
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 3 commits
a7bda74
0b01ace
735224a
9dac007
b098f4f
a5d64c4
151fdc6
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 |
---|---|---|
|
@@ -771,6 +771,26 @@ def test_integer_array_constructor_copy(): | |
assert result._mask is not mask | ||
|
||
|
||
def test_integer_Series_iter_return_native(): | ||
expected = int | ||
result = type(pd.Series([1, 2], dtype="int64").tolist()[0]) | ||
assert expected == result | ||
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 think it's generally preferred to use
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. But that would become 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. What I meant was
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. Oh, okay. I will commit that soon. 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 have done that. Can you review it, please? |
||
result = type(pd.Series([1, 2], dtype="Int64").tolist()[0]) | ||
assert expected == result | ||
result = type(pd.Series([1, 2], dtype="int64").to_dict()[0]) | ||
assert expected == result | ||
result = type(pd.Series([1, 2], dtype="Int64").to_dict()[0]) | ||
assert expected == result | ||
result = type(list(pd.Series([1, 2], dtype="int64").iteritems())[0][1]) | ||
assert expected == result | ||
result = type(list(pd.Series([1, 2], dtype="Int64").iteritems())[0][1]) | ||
assert expected == result | ||
result = type(list(iter(pd.Series([1, 2], dtype="int64")))[0]) | ||
assert expected == result | ||
result = type(list(iter(pd.Series([1, 2], dtype="Int64")))[0]) | ||
assert expected == result | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"values", | ||
[ | ||
|
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.
I think we could actually move this to base masked and/or the base EA interface (maybe)