-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
TST: add test for Series.item backed with ExtensionArray #30318
TST: add test for Series.item backed with ExtensionArray #30318
Conversation
# https://github.com/pandas-dev/pandas/pull/30175 | ||
s = pd.Series(data) | ||
result = s[:1].item() | ||
assert result == data[0] |
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 wanted to add a more exact test for the type of the object (assert isinstance(result, data.dtype.type)
), but this actually doesn't hold for all our dtypes (eg for categorical dtype)
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 had an issue about that somewhere. But this seems sufficient.
Follow-up on #30175
cc @jbrockmendel