-
Notifications
You must be signed in to change notification settings - Fork 968
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 proper NA for integer64 on assign #3724
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3724 +/- ##
==========================================
+ Coverage 99.41% 99.41% +<.01%
==========================================
Files 71 71
Lines 13210 13216 +6
==========================================
+ Hits 13133 13139 +6
Misses 77 77
Continue to review full report at Codecov.
|
There is a more tricky case that is not being handled by this PR, a sub-assign NA to existing int64 column data.table(a=1:2, b=bit64::as.integer64(1:2))[2L, c("a","b") := NA][]
# a b
# <int> <i64>
#1: 1 1
#2: NA 9218868437227407266 You might not try to address it in this PR, after having #3765 merged it should be easier. |
Closes #3723
Closes #1459
There's probably a better way to do this, but I couldn't think of one.
The problem is
writeNA
isinteger64
-aware, butallocNAVector
is not because it operates onSEXPTYPE
so it forgets about the source vector & its attributes.Landed on defining
allocNAVectorLike
to allocate an empty vector akin tox
. Played with two other versions before scrapping:allocNAVector
to operate asallocNAVectorLike
does. This didn't work because of the usages infmelt
, e.g.. There,allocNAVector
isn't matching a specific column, but rather the bumped-to type in reshaping (using the type hierarchy on themeasure.vars
).is_i64
toallocNAVector
andwriteNA
. First this feels pretty hackish (what other attributes will need a new/different parameter?), and second I got stuck because some usages ofwriteNA
are sending anSEXP
and I'm not confident we can alwaysINHERITS(x, char_integer64)
in those cases inrbindlist
.