-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Use a consistent argument order for trunc
(Dates)
#50949
Comments
Oh, interesting. The (valid) justification in #18574 doesn't really apply to |
The doc strings for these operations are also all messed up. We have
That "for convenience..." clause is describing |
I think the same argument could be applied here. The second argument is not just specifying the return type but also the precision (digits), because we have round(Nanosecond(1234567890), Millisecond) != round(Nanosecond(1234567890), Second) |
IMO the latter should only specify the precision; the return type should still be |
Here too #47786 |
It's fixed here #47843? New correct order should be added, but is there really a reason to drop or deprecate the old order? It could be a no-inline (or not) cheap version, to not break compatibility. [Currently DateTimes supports only one precision, plus in seconds, which is implied if no fractional part (is trunc mean to that, to state it implicitly?). It seems then you can't represent down to .000 meaning those are meaningful. It's to discuss elsewhere, and I guess more than allowing just two precision, both even finer as currently ongoing, and lesser, e.g. to the hour or to week of the year.] |
@barucden noted that we have this:
Dates
should not violate the normal argument order here, it should put the destination type first (just likeconvert
,round
,floor
, etc..)This also applies to
floor
,ceil
, andround
.The text was updated successfully, but these errors were encountered: