-
Notifications
You must be signed in to change notification settings - Fork 1k
t1-t2 only gains difftime class optionally #7237
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
base: master
Are you sure you want to change the base?
Conversation
Generated via commit ec3f850 Download link for the artifact containing the test results: ↓ atime-results.zip
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7237 +/- ##
=======================================
Coverage 99.02% 99.02%
=======================================
Files 87 87
Lines 16803 16804 +1
=======================================
+ Hits 16640 16641 +1
Misses 163 163 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
NEWS.md
Outdated
|
|
||
| 1. `data.table(x=1, <expr>)`, where `<expr>` is an expression resulting in a 1-column matrix without column names, will eventually have names `x` and `V2`, not `x` and `V1`, consistent with `data.table(x=1, <expr>)` where `<expr>` results in an atomic vector, for example `data.table(x=1, cbind(1))` and `data.table(x=1, 1)` will both have columns named `x` and `V2`. In this release, the matrix case continues to be named `V1`, but the new behavior can be activated by setting `options(datatable.old.matrix.autoname)` to `FALSE`. See point 5 under Bug Fixes for more context; this change will provide more internal consistency as well as more consistency with `data.frame()`. | ||
|
|
||
| 2. `t1 - t2`, where both `t1` and `t2` are `IDate`, will eventually have class `difftime`, consistent with the case where `t1` and `t2` are both `Date`. You can activate the new behavior by setting `options(datatable.old.diff.time = FALSE)`. See point 17 under Bug Fixes for more context. |
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.
Make sense to mention this option is only for temporary transition and should be generally avoided in favor of adapting code to the change
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.
"you can activate the new behavior by setting ..." is confusing to me. Isn't the default for this option to not be set, so it gets value NULL, which means the code will set the class/units attributes? In that case the new behavior is already activated and you would have to deactivate it if you want by setting the option TRUE, right?
|
it defaults to TRUE (in .onLoad)
…On Wed, Aug 27, 2025, 6:44 AM Toby Dylan Hocking ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In NEWS.md
<#7237 (comment)>
:
> @@ -8,6 +8,8 @@
1. `data.table(x=1, <expr>)`, where `<expr>` is an expression resulting in a 1-column matrix without column names, will eventually have names `x` and `V2`, not `x` and `V1`, consistent with `data.table(x=1, <expr>)` where `<expr>` results in an atomic vector, for example `data.table(x=1, cbind(1))` and `data.table(x=1, 1)` will both have columns named `x` and `V2`. In this release, the matrix case continues to be named `V1`, but the new behavior can be activated by setting `options(datatable.old.matrix.autoname)` to `FALSE`. See point 5 under Bug Fixes for more context; this change will provide more internal consistency as well as more consistency with `data.frame()`.
+2. `t1 - t2`, where both `t1` and `t2` are `IDate`, will eventually have class `difftime`, consistent with the case where `t1` and `t2` are both `Date`. You can activate the new behavior by setting `options(datatable.old.diff.time = FALSE)`. See point 17 under Bug Fixes for more context.
"you can activate the new behavior by setting ..." is confusing to me.
Isn't the default for this option to not be set, so it gets value NULL,
which means the code will set the class/units attributes? In that case the
new behavior is already activated and you would have to deactivate it if
you want by setting the option TRUE, right?
—
Reply to this email directly, view it on GitHub
<#7237 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2BA5IT6TJZ7S5LKTRNCX33PWY2VAVCNFSM6AAAAACDISE5O2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTCNJZHA3DEOBUHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
d0efdf0 to
c55653e
Compare

For #7229 / follow-up to #7213 -- in the next release, don't "award" the
difftimeclass, but make that available.