paleolimbot commented on code in PR #12817:
URL: https://github.com/apache/arrow/pull/12817#discussion_r853309711
##########
r/R/util.R:
##########
@@ -138,18 +138,17 @@ handle_parquet_io_error <- function(e, format) {
stop(e)
}
-is_writable_table <- function(x) {
- inherits(x, c("data.frame", "ArrowTabular"))
-}
-
-# This attribute is used when is_writable is passed into assert_that, and
allows
-# the call to form part of the error message when is_writable is FALSE
-attr(is_writable_table, "fail") <- function(call, env) {
- paste0(
- deparse(call$x),
- " must be an object of class 'data.frame', 'RecordBatch', or 'Table', not
'",
- class(env[[deparse(call$x)]])[[1]],
- "'."
+as_writable_table <- function(x, arg_name = "x") {
Review Comment:
I opted to just simplify this a bit...it only gets used in a few places!
I'll send you a message about the use of `sys.call()` vs `caller_env()`...I did
some digging and it makes sense to me now why the docs say to use
`caller_env()`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]