AlenkaF commented on code in PR #12855:
URL: https://github.com/apache/arrow/pull/12855#discussion_r854052860
##########
r/R/dplyr-funcs-datetime.R:
##########
@@ -376,6 +376,21 @@ register_bindings_duration_helpers <- function() {
register_binding("dyears", function(x = 1) {
make_duration(x * 31557600, "s")
})
+ register_binding("dseconds", function(x = 1) {
+ make_duration(x, "s")
+ })
+ register_binding("dmilliseconds", function(x = 1) {
+ make_duration(x, "ms")
+ })
+ register_binding("dmicroseconds", function(x = 1) {
+ make_duration(x, "us")
+ })
+ register_binding("dnanoseconds", function(x = 1) {
+ make_duration(x, "ns")
+ })
+ register_binding("dpicoseconds", function(x = 1) {
+ abort("Duration in picoseconds not supported in Arrow.")
+ })
Review Comment:
Yeah, it would be good to post an output 🤦♀️
<details>
<summary>See the output:</summary>
<pre>
```R
> devtools::test(filter="datetime")
ℹ Loading arrow
Some features are not enabled in this build of Arrow. Run `arrow_info()` for
more information.
ℹ Testing arrow
Some features are not enabled in this build of Arrow. Run `arrow_info()` for
more information.
✔ | F W S OK | Context
✖ | 7 381 | dplyr-funcs-datetime [2.0s]
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Failure (test-dplyr-funcs-datetime.R:1263:3): dminutes, dhours, ddays,
dweeks, dmonths, dyears
`via_batch <- rlang::eval_tidy(expr, rlang::new_data_mask(rlang::env(.input
= record_batch(tbl))))` threw an unexpected warning.
Message: Expression dyears(x) not supported in Arrow; pulling data into R
Class: simpleWarning/warning/condition
Backtrace:
1. arrow:::compare_dplyr_binding(...)
at test-dplyr-funcs-datetime.R:1263:2
12. arrow::mutate.ArrowTabular(...)
13. arrow::abandon_ship(call, .data, msg)
at r/R/dplyr-mutate.R:62:6
Failure (test-dplyr-funcs-datetime.R:1263:3): dminutes, dhours, ddays,
dweeks, dmonths, dyears
`via_table <- rlang::eval_tidy(expr, rlang::new_data_mask(rlang::env(.input
= arrow_table(tbl))))` threw an unexpected warning.
Message: Expression dyears(x) not supported in Arrow; pulling data into R
Class: simpleWarning/warning/condition
Backtrace:
1. arrow:::compare_dplyr_binding(...)
at test-dplyr-funcs-datetime.R:1263:2
12. arrow::mutate.ArrowTabular(...)
13. arrow::abandon_ship(call, .data, msg)
at r/R/dplyr-mutate.R:62:6
Failure (test-dplyr-funcs-datetime.R:1278:3): dminutes, dhours, ddays,
dweeks, dmonths, dyears
`via_batch <- rlang::eval_tidy(expr, rlang::new_data_mask(rlang::env(.input
= record_batch(tbl))))` threw an unexpected warning.
Message: Expression date_to_add + ddays - dhours(3) not supported in Arrow;
pulling data into R
Class: simpleWarning/warning/condition
Backtrace:
1. arrow:::compare_dplyr_binding(...)
at test-dplyr-funcs-datetime.R:1278:2
12. arrow::mutate.ArrowTabular(...)
13. arrow::abandon_ship(call, .data, msg)
at r/R/dplyr-mutate.R:62:6
Failure (test-dplyr-funcs-datetime.R:1278:3): dminutes, dhours, ddays,
dweeks, dmonths, dyears
`via_table <- rlang::eval_tidy(expr, rlang::new_data_mask(rlang::env(.input
= arrow_table(tbl))))` threw an unexpected warning.
Message: Expression date_to_add + ddays - dhours(3) not supported in Arrow;
pulling data into R
Class: simpleWarning/warning/condition
Backtrace:
1. arrow:::compare_dplyr_binding(...)
at test-dplyr-funcs-datetime.R:1278:2
12. arrow::mutate.ArrowTabular(...)
13. arrow::abandon_ship(call, .data, msg)
at r/R/dplyr-mutate.R:62:6
Failure (test-dplyr-funcs-datetime.R:1292:3): dminutes, dhours, ddays,
dweeks, dmonths, dyears
`via_batch <- rlang::eval_tidy(expr, rlang::new_data_mask(rlang::env(.input
= record_batch(tbl))))` threw an unexpected warning.
Message: Expression dminutes(1) not supported in Arrow; pulling data into R
Class: simpleWarning/warning/condition
Backtrace:
1. arrow:::compare_dplyr_binding(...)
at test-dplyr-funcs-datetime.R:1292:2
12. arrow::mutate.ArrowTabular(...)
13. arrow::abandon_ship(call, .data, msg)
at r/R/dplyr-mutate.R:62:6
Failure (test-dplyr-funcs-datetime.R:1292:3): dminutes, dhours, ddays,
dweeks, dmonths, dyears
`via_table <- rlang::eval_tidy(expr, rlang::new_data_mask(rlang::env(.input
= arrow_table(tbl))))` threw an unexpected warning.
Message: Expression dminutes(1) not supported in Arrow; pulling data into R
Class: simpleWarning/warning/condition
Backtrace:
1. arrow:::compare_dplyr_binding(...)
at test-dplyr-funcs-datetime.R:1292:2
12. arrow::mutate.ArrowTabular(...)
13. arrow::abandon_ship(call, .data, msg)
at r/R/dplyr-mutate.R:62:6
Error (test-dplyr-funcs-datetime.R:1312:3): dseconds, dmilliseconds,
dmicroseconds, dnanoseconds, dpicoseconds
Error in `collect(.)`: NotImplemented: Function 'multiply_checked' has no
kernel matching input types (array[int32], scalar[string])
/Users/alenkafrim/repos/arrow/cpp/src/arrow/compute/exec/expression.cc:340
call.function->DispatchBest(&descrs)
/Users/alenkafrim/repos/arrow/cpp/src/arrow/compute/exec/expression.cc:411
BindImpl(std::move(argument), in, shape, exec_context)
/Users/alenkafrim/repos/arrow/cpp/src/arrow/compute/exec/expression.cc:411
BindImpl(std::move(argument), in, shape, exec_context)
/Users/alenkafrim/repos/arrow/cpp/src/arrow/compute/exec/project_node.cc:67
expr.Bind(*inputs[0]->output_schema())
Backtrace:
1. arrow:::compare_dplyr_binding(...)
at test-dplyr-funcs-datetime.R:1312:2
11. arrow::collect.arrow_dplyr_query(.)
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
══ Results
══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
Duration: 2.2 s
[ FAIL 7 | WARN 0 | SKIP 0 | PASS 381 ]
```
</pre>
</details>
--
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]