-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
TST: Verify isin returns consistent results for passed iterables #50443
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: Verify isin returns consistent results for passed iterables #50443
Conversation
…lts for passed iterables
MarcoGorelli
left a comment
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.
This is off to a good start!
MarcoGorelli
left a comment
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.
couple more minor comments, then looks good to me
@phofl any further comments?
|
|
||
| @pytest.mark.parametrize( | ||
| "data", | ||
| [([1, 2, 3]), ([1.0, 2.0, 3.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.
looks like you've got some extra brackets (I'm surprised none of the linters caught this)
| [([1, 2, 3]), ([1.0, 2.0, 3.0])], | |
| [[1, 2, 3], [1.0, 2.0, 3.0]], |
| # GH 50234 | ||
|
|
||
| ser = Series(data) | ||
| result = ser.isin(i for i in [1, 2]) |
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.
sorry, I didn't catch this the first time round - doesn't the original issue have (i for i in [1.0, 2.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.
Agreed, we should parametrize over both, e.g. [1, 2] and [1.0, 2.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.
Good point! Updated parameters accordingly.
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.
Nice, thanks @jessica-writes-code ! Looks good to me pending green

Add tests to verify that the
Seriesmethodisinreturns consistent results when passed iterables with different dtypes. (See #50234.)Added type annotations to new arguments/methods/functions.(Not applicable.)Added an entry in the latest(Not applicable.)doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.