thisisnic commented on code in PR #14220:
URL: https://github.com/apache/arrow/pull/14220#discussion_r978632179
##########
r/R/dplyr-funcs-augmented.R:
##########
@@ -28,7 +28,13 @@
#' mutate(file = add_filename())
#' }
#' @keywords internal
-add_filename <- function() Expression$field_ref("__filename")
+add_filename <- function(){
+
+ if (!caller_env(n = 2)$x$is_dataset) {
+ abort("`add_filename()` must only be called on Dataset objects.")
+ }
Review Comment:
This currently is never triggered, because if we look at the value of
`caller_env(n = 2)$x` here it's an object of class FileSystemDataset (query)
even with a Table, e.g. via `arrow_table(tibble::tibble(x = 1:3)) %>%
mutate(file = add_filename())`
--
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]