amoeba commented on code in PR #35398:
URL: https://github.com/apache/arrow/pull/35398#discussion_r1195809606
##########
r/R/filesystem.R:
##########
@@ -384,7 +387,24 @@ S3FileSystem <- R6Class("S3FileSystem",
region = function() fs___S3FileSystem__region(self)
)
)
-S3FileSystem$create <- function(anonymous = FALSE, ...) {
+S3FileSystem$create <- function(
+ anonymous = FALSE,
+ log_level = c("fatal", "error", "warn", "info", "debug", "trace", "off"),
+ ...) {
+ # Init S3 now only if log_level is set
+ # TODO: This is clunky
Review Comment:
I thought this looked clunky but wasn't sure how best to guard this code. It
seems like the way you're supposed to use `rlang::arg_match` is to make the
first option in your set of options the default and just write code like,
```r
S3FileSystem$create <- function(log_level = c("fatal", "error", "warn",
"info", "debug", "trace", "off")) {
log_level <- rlang::arg_match(log_level)
InitS3(log_level)
# continue
}
```
However we don't always want to call InitS3(), hence the reason for guarding
it like I did. Any suggestions welcome.
--
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]