You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Wainberg (via GitHub)" <gi...@apache.org> on 2024/03/29 14:37:04 UTC

[I] [R] Cryptic error when creating Arrow array from POSIXct with invalid time zones [arrow]

Wainberg opened a new issue, #40886:
URL: https://github.com/apache/arrow/issues/40886

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   POSIXct is tricky because you can construct one with an invalid timezone and it won't give an error until you print it:
   
   ```R
   > a = as.POSIXct(1, NA)
   > print(a)
   Error in as.POSIXlt.POSIXct(x, tz) : invalid 'tz' value
   ```
   
   But at least the error itself is easily understandable. When you try to create an Arrow array from such a POSIXct, you instead get a cryptic error:
   
   ```R
   > arrow::Array$create(as.POSIXct(1, 1))
   Error in vec_to_Array(x, type) :
     STRING_ELT() can only be applied to a 'character vector', not a 'double'
   > arrow::Array$create(as.POSIXct(1, NA))
   Error in vec_to_Array(x, type) :
     STRING_ELT() can only be applied to a 'character vector', not a 'logical'
   ```
   
   ### Component(s)
   
   R


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [R] Cryptic error when creating Arrow array from POSIXct with invalid time zones [arrow]

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic closed issue #40886: [R] Cryptic error when creating Arrow array from POSIXct with invalid time zones
URL: https://github.com/apache/arrow/issues/40886


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [R] Cryptic error when creating Arrow array from POSIXct with invalid time zones [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on issue #40886:
URL: https://github.com/apache/arrow/issues/40886#issuecomment-2050093943

   Thanks for the report @Wainberg. I do think it's ideal that arrow could give a better error even if R's doesn't. I think we could safely make this section more restrictive, possibly throwing an error or converting non-character inputs to character first:
   
   https://github.com/apache/arrow/blob/7288bd557354677a9f1238ca652e528c5d522887/r/src/type_infer.cpp#L88-L94
   
   I'll get some eyes on this and plan to put a fix up if we think that's appropraite. Thanks again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [R] Cryptic error when creating Arrow array from POSIXct with invalid time zones [arrow]

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on issue #40886:
URL: https://github.com/apache/arrow/issues/40886#issuecomment-4289540455

   Issue resolved by pull request 49714
   https://github.com/apache/arrow/pull/49714


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org