-
Notifications
You must be signed in to change notification settings - Fork 2k
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
GH-15677 Fix Match function bug #15896
Conversation
h2o-core/src/main/java/water/rapids/ast/prims/search/AstMatch.java
Outdated
Show resolved
Hide resolved
h2o-core/src/main/java/water/rapids/ast/prims/search/AstMatch.java
Outdated
Show resolved
Hide resolved
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 @maurever.
Added some suggestions for doc + concern about sorted numerical values.
@hannah-tillman Could you check the documentation of this feature, please? Thanks! |
h2o-core/src/main/java/water/rapids/ast/prims/search/AstMatch.java
Outdated
Show resolved
Hide resolved
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.
made a few docs updates -- good on my end :)
h2o-core/src/main/java/water/rapids/ast/prims/search/AstMatch.java
Outdated
Show resolved
Hide resolved
h2o-core/src/main/java/water/rapids/ast/prims/search/AstMatch.java
Outdated
Show resolved
Hide resolved
h2o-core/src/main/java/water/rapids/ast/prims/search/AstMatch.java
Outdated
Show resolved
Hide resolved
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.
looking good, thanks @maurever
Apparently, you still need to rebase to resolve conflicts, so I will approve next time.
h2o-core/src/main/java/water/rapids/ast/prims/search/AstMatch.java
Outdated
Show resolved
Hide resolved
e6ed78c
to
4d30c38
Compare
Thanks, @sebhrusen; the PR is updated based on your suggestion and rebased. |
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.
tested the Py doc generation with the result rendered in the example, it works nicely!
Also updated the suggestion to use real data from the example.
Maybe same could be done in R.
@hannah-tillman, please check that the documentation is generated correctly. @sebhrusen also suggested adding output into the R example, but I think it will not work in the R. If you have any idea how to improve the R example to be similar to the Python example, please let me know (or feel free to commit this change here). Thanks! |
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.
LGTM, thanks @maurever
I took the initiative to commit a small fix in the Py example.
Regarding the R example, looking at R doc, I don't think it's possible to render the results the same way as we can in Py, common practice seems to be using a comment, like:
sample ##--> describe shortly what is expected when this is printed
for example, in this case
sample ##--> `match` column should be made of `1` for `setosa`, `2` for `versicolor` and `NaN` for `virginica`
@maurever The python docs build fine 👍 For the R documentation, I went through the current R guide to find an example of something adding the output because I didn’t really remember that happening. What I was able to find was a rare case of output being added as a comment, so we could do the same for this? Would look like this:
This is the only example I was able to find for output in the R docs, though, so it is currently the only idea i have. Let me know if this is what you want. |
…o-3 into maurever_GH-15677_fix_match_bug
Thanks, @seb and @hannah-tillman. The PR is now ready for review. |
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.
LG, thank you @maurever !
Issue: #15677
TODO:
nomatch
should be NaN for both R and Python. In addition, only allow NaN or other numerical values fornomatch
values. No string is supported.nomatch
is defaulted to NaN and can only be numerical values. Remove the last sentences for incomparables.start_index
with default value = 1, if a user wants to change indexing from 0 for example