You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/09 07:57:21 UTC

[GitHub] [arrow] dragosmg commented on pull request #13055: ARROW-16253: [R] Helper function for casting from float to duration via int64()

dragosmg commented on PR #13055:
URL: https://github.com/apache/arrow/pull/13055#issuecomment-1120768325

   Thanks @Jon. I should've probably offered some details on why I didn't use `make_duration()` in those places.
   
   https://github.com/apache/arrow/blob/3a646b35b29e52ca8eca995eb83af29c44b191c4/r/R/dplyr-funcs-datetime.R#L415-L417
   
   I had added a comment in https://github.com/apache/arrow/pull/13055/commits/b4ccc08125e015b3fdb901ab3f796e3a3ca379fc, on why `make_duration()` cannot be used there. We need the casting chain for a second reason, i.e. to get the units right. Switching to `make_duration()` would involve adding another transformation to account for the change in measurement unit. There is a relevant conversation over at [ARROW-15996](https://issues.apache.org/jira/browse/ARROW-15996).
   
   for 
   
   https://github.com/apache/arrow/blob/3a646b35b29e52ca8eca995eb83af29c44b191c4/r/R/dplyr-funcs-datetime.R#L354-L355
   
   Done! That was an oversight
   
   for 
   
   https://github.com/apache/arrow/blob/3a646b35b29e52ca8eca995eb83af29c44b191c4/r/R/dplyr-datetime-helpers.R#L146
   
   we can't really use `make_duration()` there (as only the cast to `int64()`, and not the cast to `duration("s")` is needed) so I deleted the comment referencing [ARROW-16253](https://issues.apache.org/jira/browse/ARROW-16253).


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org