Skip to content

Commit

Permalink
package, stop using new R feature, stick to legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
meztez committed Apr 22, 2024
1 parent 3dc909a commit 93cb1da
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions R/bqs_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -304,28 +304,28 @@ parse_postprocess <- function(df, bigint, fields) {
character = as.character
)
tests[["bigint"]] <- list(
"test" = \(x,y) bit64::is.integer64(x),
"func" = \(x) as_bigint(x)
"test" = function(x,y) bit64::is.integer64(x),
"func" = function(x) as_bigint(x)
)
}
if (has_type(fields, "DATETIME")) {
tests[["DATETIME"]] <- list(
"test" = \(x,y) {y[["type"]] %in% "DATETIME"},
"func" = \(x) {attr(x, "tzone") <- "UTC"; x}
"test" = function(x,y) {y[["type"]] %in% "DATETIME"},
"func" = function(x) {attr(x, "tzone") <- "UTC"; x}
)
}
if (has_type(fields, "GEOGRAPHY")) {
bqs_check_namespace("wk", "GEOGRAPHY")
tests[["GEOGRAPHY"]] <- list(
"test" = \(x,y) y[["type"]] %in% "GEOGRAPHY",
"func" = \(x) {attr(x, "class") <- c("wk_wkt", "wk_vctr");x}
"test" = function(x,y) y[["type"]] %in% "GEOGRAPHY",
"func" = function(x) {attr(x, "class") <- c("wk_wkt", "wk_vctr");x}
)
}
if (has_type(fields, "BYTES")) {
bqs_check_namespace("blob", "BYTES")
tests[["BYTES"]] <- list(
"test" = \(x,y) y[["type"]] %in% "BYTES",
"func" = \(x) {
"test" = function(x,y) y[["type"]] %in% "BYTES",
"func" = function(x) {
attr(x, "class") <- c("blob", "vctrs_list_of", "vctrs_vctr", "list")
attr(x, "ptype") <- raw(0)
x
Expand Down

0 comments on commit 93cb1da

Please sign in to comment.