-
Notifications
You must be signed in to change notification settings - Fork 19
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
Implementing order functions where missings is the smallest value #144
Conversation
I will ask users on slack for opinion about naming. |
|
A good comment by Alexander Plavin on Slack:
Maybe it is easy enough (and just should be documented) The only downside is that in interactive use it triggers recompilation each time. |
IMO it's too hard to discover and remember. At least Let's continue the discussion regarding names at JuliaData/DataFrames.jl#2267 to avoid spreading it over several issues, and discuss the implementation here? |
Co-authored-by: Milan Bouchet-Valat <[email protected]>
While thinking of new test sets I came across something interesting. The current implementation only works for comparisons of the same "semantics" as I think this is either okay if we only expect users to compare using comparison functions that behave like |
Could you show examples? I'm a bit confused about what you mean. |
Sorry, I think I could have explained it a bit better. What I mean is, the fact that we rely on the order of the arguments to place More concretely.
But since the current implementation always returns As I said I am not sure if this could be a problem. In the concrete example of |
Your comment is good. Maybe we do not need to add anything but instead recommend using the following:
and this is enough. Then the only question is why
|
I think that would work. My only concern would be, what if the user wants to use something that behaves like |
@alonsoC1s - so we have a conclusion regarding the API in JuliaData/DataFrames.jl#2267. |
@bkamins sure, I'll work on this on the weekend so we can hopefully have it resolved by next week |
@bkamins I implemented the version suggested by @LilithHafner without the the changes that would need to be upstreamed to Base |
@alonsoC1s - is it clear what should be corrected? |
I believe so. I'll get to work on the latests comments :) |
Thanks! |
Nightly failures are unrelated. |
Should we also add |
My inclination is to make the documentation of |
@bkamins, should this be merged? |
I approved it already some time ago. We are waiting for @nalimilan before merging. |
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've found a pair of remaining issues in doctests (as unfortunately we don't test them since we don't build a manual).
@LilithHafner Bumping this. The final changes seem pretty small before merging. |
Sorry about the delay. I recommend accepting @nalimilan's suggestions and then then merging into main if CI still passes. I don't have commit bit here. cc @bkamins, @nalimilan. |
Ah sorry! I thought you were the one making the changes! @alonsoC1s can you make the final changes? |
@alonsoC1s - when you finalize the PR can you also update the tests so that they pass both on the current release and on nightly? (there is an issue I think that depending on Julia version a different exception type is thrown in some cases). Thank you! |
Co-authored-by: Milan Bouchet-Valat <[email protected]>
I have commited the suggestions. |
@bkamins sure, I'll be happy to. This week is a bit busy, but I will wrap everything up as soon as I can get some free time |
@bkamins I'm taking a look at the reasons for failure on different Julia versions and I think you are right, different versions throw different Errors. What is the best practice for dealing with this version-specific behaviour? |
I typically test for an abstract error that is a supertype of the errors thrown. |
Agreed, I'll test for more general Exceptions |
@nalimilan - OK to merge? |
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.
Thanks!
Thank you! |
As discussed in issue #142, this PR adds a variant of the standard
isless
function where the smallest possible value ismissing
. Furthermore, this PR adds a partial order functionmissingsmallest
that takes a partial order functionf
and modifies the order such thatmissing
is always less than the other argument.This PR aims to provide support to resolve issue JuliaData/DataFrames.jl#2267 at DataFrames.jl