thisisnic commented on a change in pull request #10387:
URL: https://github.com/apache/arrow/pull/10387#discussion_r640456625
##########
File path: r/R/util.R
##########
@@ -110,3 +110,18 @@ handle_embedded_nul_error <- function(e) {
}
stop(e)
}
+
+check_tabular <- function(x, format) {
+ if (!inherits(x, "ArrowTabular")) {
+ abort(
+ c(
+ paste0("Cannot write to ", format, "."),
+ x = paste0(
+ "`x` must be an object of class 'data.frame', 'RecordBatch', or
'Table', not '",
+ class(x)[1],
+ "'"
+ )
+ )
+ )
+ }
+}
Review comment:
Thanks for looking at this- have updated it to do this now to return
`invisible(x)` & will update the tests to use `expect_snapshot_error` when
making a PR to upgrade to testthat 3e.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]