-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
ARROW-15010: [R] Create a function registry for our NSE funcs #11904
Conversation
…n test-dplyr-summarise.R)
…ster_translation()
|
I think this is best saved for a follow-up, but when I read this comment from Jon...
It got me thinking: wouldn't it be nice if users could call any registered function by its namespace-qualified name or by its unqualified name? For example a user could call To achieve that, maybe |
Co-authored-by: Ian Cook <ianmcook@gmail.com>
Co-authored-by: Ian Cook <ianmcook@gmail.com>
There's a JIRA on this one (ARROW-14575)! In the PR for that JIRA we'd add the package names to all our currently registered functions, implement a slightly different registry that keeps track of packages instead of discarding it, and implement a binding for I chose to keep the namespace with the function in the same string because that's what |
All sounds good to me 👍 Looks like some of the CI jobs were failing because of 404 errors from RStudio Package Manager. I restarted them. |
@paleolimbot is there anything else you think needs to be done in this PR before it gets merged? @paleolimbot the docs added in ARROW-13834 need to be updated to reflect the changes in this PR. Do you want to do that after this merges? If so can you please create a Jira for that? Thanks @jonkeane @nealrichardson are you satisfied with the responses to your review comments above? |
I think this PR is ready to be merged from my perpspective (pending any changes requested by Neal, Ian, or Jon). I created ARROW-15193 for doc updates...I'll do it after this is merged. |
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.
These changes look good to me, thanks for them (and thanks to Ian and Neal for the comments).
The suggestions here are only possible whitespace cleanups. I'm happy to merge this, but will wait until early next week to make sure people have a chance to come back and object before I do.
Co-authored-by: Jonathan Keane <jkeane@gmail.com>
Co-authored-by: Jonathan Keane <jkeane@gmail.com>
Co-authored-by: Jonathan Keane <jkeane@gmail.com>
Co-authored-by: Jonathan Keane <jkeane@gmail.com>
Co-authored-by: Jonathan Keane <jkeane@gmail.com>
Co-authored-by: Jonathan Keane <jkeane@gmail.com>
options = list(field_names = names(args)) | ||
) | ||
}) | ||
} |
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 extraneous, no? And it looks like the lines above this are also indented?
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.
Ah no, my bad, this actually needed register_bindings_type_cast <- function() {
above it
29fe0d6
to
54286eb
Compare
Now that #11904 is merged (ARROW-15010), we have slightly different syntax for defining bindings between compute C++ and R functions. @thisisnic wrote some excellent documentation for creating bindings which needs a few tweaks to reflect how this is now done! Closes #12075 from paleolimbot/r-binding-docs Authored-by: Dewey Dunnington <dewey@fishandwhistle.net> Signed-off-by: Nic Crane <thisisnic@gmail.com>
This PR is to fix a valgrind failure that started occurring after #11904 (ARROW-15010) was merged. Closes #12090 from paleolimbot/r-tests-re Authored-by: Dewey Dunnington <dewey@fishandwhistle.net> Signed-off-by: Jonathan Keane <jkeane@gmail.com>
This is PR implementing that admittedly does a few things. I'd be happy to split up with a suggestion on the desired steps if that makes it easier to review. In fact, I'm totally game to use reviews on this PR to collect ideas about the changes that collectively we agree on and just implement that subset in a new PR.
This PR:
register_translation()
andregister_translation_agg()
instead of direct assignment intonse_funcs
andagg_funcs
. This enables attaching a package name when the function is being registered (e.g.,register_translation("stringr::str_dup", function(x, ...) ...)
) and makes it possible in the future to allow other packages to define translations and/or for us to change how we evaluate translated expressions without changing many function assignments.nse_funcs
andagg_funcs
except where used to implement evaluationThis PR does not:
Reprex with the gist of how the registration works:
Created on 2021-12-08 by the reprex package (v2.0.1)