Skip to content
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

Merged
merged 1 commit into from
Dec 18, 2019

Conversation

jorisvandenbossche
Copy link
Member

Follow-up on #30175

cc @jbrockmendel

# https://github.com/pandas-dev/pandas/pull/30175
s = pd.Series(data)
result = s[:1].item()
assert result == data[0]
Copy link
Member Author

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)

Copy link
Contributor

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.

@jorisvandenbossche jorisvandenbossche added ExtensionArray Extending pandas with custom dtypes or arrays. Testing pandas testing functions or related to the test suite labels Dec 18, 2019
@jorisvandenbossche jorisvandenbossche added this to the 1.0 milestone Dec 18, 2019
@TomAugspurger TomAugspurger merged commit c39e178 into pandas-dev:master Dec 18, 2019
jbrockmendel added a commit to jbrockmendel/pandas that referenced this pull request Dec 18, 2019
TomAugspurger pushed a commit that referenced this pull request Dec 18, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
AlexKirko pushed a commit to AlexKirko/pandas that referenced this pull request Dec 29, 2019
AlexKirko pushed a commit to AlexKirko/pandas that referenced this pull request Dec 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays. Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants