-
Notifications
You must be signed in to change notification settings - Fork 990
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
shift fix type coercion for integer64 #5189
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5189 +/- ##
==========================================
- Coverage 99.38% 99.38% -0.01%
==========================================
Files 77 77
Lines 14541 14532 -9
==========================================
- Hits 14452 14443 -9
Misses 89 89
Continue to review full report at Codecov.
|
NB: coverage decrease is spurious |
src/shift.c
Outdated
} else { | ||
thisfill = PROTECT(coerceVector(fill, REALSXP)); | ||
} | ||
SEXP thisfill = PROTECT(coerceAs(fill, elem, ScalarLogical(0))); // #4865 use coerceAs for (NA) type coercion |
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.
very nice! i.e. glad to see the back of NA_INT64_LL
and those unsigned long long
casts.
I tackled the news item by focusing it on the most easily conveyed example: |
I guess thats also kind of my fault. I only exchanged the coercing for the cases: Whats then still missing is the conversion from |
Looking at the > DT = data.table(A=letters[1:3])
> DT
A
<char>
1: a
2: b
3: c
> DT[2, A:=as.Date("2020-03-04")]
> DT
A
<char>
1: a
2: 18325
3: c
> |
Tiny % drop in project coverage (and hence coverage fail on project vs 100% coverage of diff) is correct due to removal of covered code. |
Closes #4865
Also changes type coercion for the
integer
case to switch neatless betweeninteger
,double
andinteger64
.