paleolimbot opened a new pull request #11904:
URL: https://github.com/apache/arrow/pull/11904
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. This PR:
- Defines `register_translation()` and `register_translation_agg()` instead
of direct assignment into `nse_funcs` and `agg_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.
- Moves the registration of translations to package load time rather than
package build time. This enables splitting up translations into multiple files,
adds the usual CMD check that normal functions undergo (e.g., for use of
missing variables), and opens up the possibility of defining different
translations for different versions of packages (or omitting translations if a
package isn't installed).
- Splits up the definition of translations into dplyr-funcs-type.R,
dplyr-funcs-conditional.R, dplyr-funcs-string.R, dplyr-funcs-datetime.R, and
dplyr-funcs-math.R. This matches where the translations are tested (the test
files were named test-dplyr-funcs-string.R, etc.). Some translations were moved
to dplyr-summarise.R because the translations were being tested in
test-dplyr-summarise.R. This makes it easier for parallel PRs defining
translations and makes it easier for new contributors to figure out where tests
should go.
- Consolidates internal documentation on how to write translations into one
.Rd file rather than scattered around as comments in dplyr-functions.R as they
were before.
This PR does not:
- Change any test filenames or remove any tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]