-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: .isin(...) now coerces sets to lists #13014
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
Conversation
tests! |
I swear |
How to kill an underway Travis job? |
@@ -113,6 +113,8 @@ def isin(comps, values): | |||
raise TypeError("only list-like objects are allowed to be passed" | |||
" to isin(), you passed a " | |||
"[{0}]".format(type(values).__name__)) | |||
if com.is_set_like(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.
instead of doing this, I think you can:
if not isinstance(values, np.ndarray):
values = list(values)
Then don't even need the next check
Current coverage is 83.91%@@ master #13014 diff @@
==========================================
Files 136 136
Lines 49908 49920 +12
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 41876 41888 +12
Misses 8032 8032
Partials 0 0
|
@ch41rmn gr8. can you add a whatsnew note in bug fixes. ping when pushed. |
looks good. can you add a whatsnew note. ping when pushed. |
thanks @ch41rmn I merged this. hoping to get the release out shortly. |
Thanks for merging @jreback. Apologies I didn't get to adding the whatsnew note in time, have been away for the weekend. |
git diff upstream/master | flake8 --diff
comp.isin(values)
now coercesvalues
from a set into a list. This was failing whencomp
is a datetime dtype andvalues
is a set, where.isin
will try to runto_datetime(values)
on the unordered set and fail.