Skip to content

Commit

Permalink
Remove deprecated functions (#558)
Browse files Browse the repository at this point in the history
Fixes #551
  • Loading branch information
hadley authored Nov 6, 2023
1 parent a229f2c commit 277ed35
Show file tree
Hide file tree
Showing 31 changed files with 29 additions and 1,627 deletions.
12 changes: 0 additions & 12 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,5 @@ Collate:
'dplyr.R'
'gs-object.R'
'import-standalone-s3-register.R'
'old-auth.R'
'old-dataset.R'
'old-id.R'
'old-job-extract.R'
'old-job-query.R'
'old-job-upload.R'
'old-job.R'
'old-project.R'
'old-projects.R'
'old-query.R'
'old-table.R'
'old-tabledata.R'
'utils.R'
'zzz.R'
32 changes: 0 additions & 32 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ S3method(as_json,bq_params)
S3method(format,bq_field)
S3method(format,bq_fields)
S3method(format,gs_object)
S3method(format,size)
S3method(op_can_download,lazy_base_query)
S3method(op_can_download,lazy_query)
S3method(op_can_download,lazy_select_query)
Expand Down Expand Up @@ -110,40 +109,9 @@ export(bq_testable)
export(bq_token)
export(bq_user)
export(dbi_driver)
export(delete_dataset)
export(delete_table)
export(exists_dataset)
export(exists_table)
export(format_dataset)
export(format_table)
export(get_access_cred)
export(get_dataset)
export(get_job)
export(get_table)
export(gs_test_bucket)
export(gs_test_object)
export(has_access_cred)
export(insert_dataset)
export(insert_extract_job)
export(insert_query_job)
export(insert_table)
export(insert_upload_job)
export(list_datasets)
export(list_projects)
export(list_tabledata)
export(list_tabledata_callback)
export(list_tabledata_iter)
export(list_tables)
export(parse_dataset)
export(parse_table)
export(query_exec)
export(reset_access_cred)
export(set_access_cred)
export(set_oauth2.0_cred)
export(set_service_token)
export(src_bigquery)
export(update_dataset)
export(wait_for)
exportClasses(BigQueryConnection)
exportClasses(BigQueryDriver)
exportClasses(BigQueryResult)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# bigrquery (development version)

* Deprecated functions (i.e. those not starting with `bq_`) have been
removed (#551). These have been superseded for a long time and were formally
deprecated in bigrquery 1.3.0 (2020).

* Now uses 2nd edition of dbplyr interface (#508).

* Compatible with dbplyr 2.4.0 (#550).
Expand Down
25 changes: 25 additions & 0 deletions R/bq-perform.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,31 @@ bq_perform_upload <- function(x, values,
as_bq_job(res$jobReference)
}

# https://cloud.google.com/bigquery/docs/loading-data-cloud-storage-json#details_of_loading_json_data
export_json <- function(values) {
# Eliminate row names
rownames(values) <- NULL

# Convert times to canonical format
is_time <- vapply(values, function(x) inherits(x, "POSIXt"), logical(1))
values[is_time] <- lapply(values[is_time], format, "%Y-%m-%d %H:%M:%S")

# Convert wk_wkt to text
is_wk <- vapply(values, function(x) inherits(x, "wk_vctr"), logical(1))
values[is_wk] <- lapply(values[is_wk], as.character)

# Unbox blobs
is_blob <- vapply(values, function(x) inherits(x, "blob"), logical(1))
values[is_blob] <- lapply(values[is_blob], function(x) {
vapply(x, jsonlite::base64_enc, character(1))
})

con <- rawConnection(raw(0), "r+")
on.exit(close(con))
jsonlite::stream_out(values, con, verbose = FALSE, na = "null")

rawToChar(rawConnectionValue(con))
}

#' @export
#' @name api-perform
Expand Down
72 changes: 0 additions & 72 deletions R/old-auth.R

This file was deleted.

93 changes: 0 additions & 93 deletions R/old-dataset.R

This file was deleted.

75 changes: 0 additions & 75 deletions R/old-id.R

This file was deleted.

Loading

0 comments on commit 277ed35

Please sign in to comment.