-
Notifications
You must be signed in to change notification settings - Fork 370
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
[BREAKING] add matchmissing kwarg to joins #2504
Conversation
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 good. Though I think we should do something about NaN
(which dplyr also handles via the equivalent of matchmissing
). Maybe just throw an error if there are NaN
s for now and see whether people complain.
OK. Doing joins on floats is in general not advisable though:
(which means in particular that I am OK to error on |
Yeah |
@StefanKarpinski - do you have an opinion how As you can see @nalimilan considers if we should not just error on them. In general I understand his point, but I am not 100% sure what would be best. Given your experiences with designing |
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
cfb8858
to
baa3864
Compare
💯 If people are doing joins on floats, something has already gone seriously wrong. But kudos for trying to get it right. How are other
So for consistency, seems like |
Oh, but the original question was about |
I think I am indifferent about |
I have thought about it and I think I would leave floating point columns as they are now. One normally should not join on such columns anyway, as it is error prone in general. Instead I propose to add a comment in the docstrings warning about doing joins on floating point columns. EDIT: but if you strongly feel we should error on |
Since we can't start throwing an error without breaking, I'd rather throw an error with |
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
OK - I will disallow |
I have updated the implementation and added appropriate tests. I think that the solution I propose (to use The PR should be ready for a review. |
@test_throws ArgumentError antijoin(name_w_special, job, on=:ID) | ||
end | ||
|
||
for special in [missing, 0.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.
0.0
works even without matchmissing=:equal
, right?
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.
right, but I wanted to avoid adding the second set of the same tests. I think it is OK, as :equal
has no influence on 0.0
handling
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
Thank you! |
Fixes #2499.
This is the core implementation and update of docstrings.
I will add tests later, as it first requires #2503 to be merged and rebased against.