Commit d035788
authored
### Rationale for this change
In R 4.5.2+, `as.POSIXct(x = NULL)` creates a zero-length `POSIXct` with `INTSXP` (integer) type, not `REALSXP` (double). The `GetVectorType()` function in `r_to_arrow.cpp` only checked for `POSIXct` in the `REALSXP` branch, so it misclassified zero-length `POSIXct` as `INT32`.
### What changes are included in this PR?
Map any `POSIXct` object to correct class by adding the check to the `INTSXP` branch of `GetVectorType()`
### Are these changes tested?
Yes
### Are there any user-facing changes?
No
* GitHub Issue: #48832
Authored-by: Nic Crane <thisisnic@gmail.com>
Signed-off-by: Nic Crane <thisisnic@gmail.com>
1 parent 75c8ede commit d035788
File tree
4 files changed
+25
-2
lines changed- r
- src
- tests/testthat
4 files changed
+25
-2
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
327 | 338 | | |
328 | 339 | | |
329 | 340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
132 | 142 | | |
133 | 143 | | |
134 | 144 | | |
| |||
0 commit comments