-
Notifications
You must be signed in to change notification settings - Fork 920
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
[REVIEW] duration type unary casts and binary ops #5394
Conversation
- this builds on rapidsai#5359 and fixes or adds a few things - unifies the duration and timestamp scalars - adds `is_chrono` and relevant chrono traits - reworked the duration type so that we can support conversions between durations that can't be supported by the language(lower_precision_duration = higher_precision_duration) - include duration types in the typed tests - added tests for new unary casts with durations i have left a few TODOs which will be in the follow-up pr's
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.
reworked the duration type so that we can support conversions between durations that can't be supported by the language
Can you elaborate on this? I'm generally not supportive of sidestepping type rules that C++ has defined.
constructing a duration with a different duration (where the 2 duration types are different) requires that the period of the source duration is perfectly divisible by the time period of the target duration (if the tick counts are integral types, which is the case here). yet, the cudf timepoint (and the new duration types) allows this by performing a duration_cast of the source duration. i was wondering if there was a perceived need that was present earlier to allow these kinds of truncations to happen (i.e. there was a requirement to support something like |
- sync with upstream 0.15 and rapidsai#5359
Codecov Report
@@ Coverage Diff @@
## branch-0.15 #5394 +/- ##
============================================
Coverage 86.38% 86.38%
============================================
Files 76 76
Lines 13033 13033
============================================
Hits 11258 11258
Misses 1775 1775 Continue to review full report at Codecov.
|
- for now, it supports product of duration with tick counts
- this can also prevent implicit downcasts and truncations - one can still opt for it explicitly with unary casts
rerun tests |
- this was required in 10.0 builds due to nvcc issues - now that 10.0 builds have been removed, remove the specialization as well
another part of #5272
is_chrono
and relevant chrono traitsadd/sub/mul/div/mod
)fixed_width_column_wrapper
that can implicitly convert numeric types into target fixed width typessome of these items have already been pulled into #5359 and thus is a part of this pr (as #5359 isn't merged yet)unifies the duration and timestamp scalarsreworked the duration type so that we can support conversions between durations that can't be supported by the language (lower_precision_duration = higher_precision_duration) (chronos duration types are used)i have a left a few TODOs that will be addressed in follow-up pr's.