Skip to content

Commit 9cf65e5

Browse files
Merge pull request #193 from bkayser/bkayser/add-generation-to-gcsload
Add generation parameter to gcs_load
2 parents 60732d8 + a9d255f commit 9cf65e5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: googleCloudStorageR
22
Type: Package
3-
Version: 0.7.0.9000
3+
Version: 0.7.0.9001
44
Title: Interface with Google Cloud Storage API
55
Description: Interact with Google Cloud Storage <https://cloud.google.com/storage/>
66
API in R. Part of the 'cloudyr' <https://cloudyr.github.io/> project.
@@ -40,7 +40,7 @@ Remotes:
4040
License: MIT + file LICENSE
4141
LazyData: true
4242
VignetteBuilder: knitr
43-
RoxygenNote: 7.2.1
43+
RoxygenNote: 7.3.2
4444
Config/testthat/edition: 3
4545
Config/testthat/parallel: false
4646
Encoding: UTF-8

R/rsession.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ gcs_save <- function(...,
9898
#' @param bucket Bucket the stored objects are in
9999
#' @param envir Environment to load objects into
100100
#' @param saveToDisk Where to save the loaded file. Default same file name
101+
#' @param generation The generation number for the noncurrent version, if you have object versioning enabled in your bucket e.g. \code{"1560468815691234"}
101102
#' @param overwrite If file exists, overwrite. Default TRUE.
102103
#'
103104
#' @details
@@ -115,12 +116,13 @@ gcs_load <- function(file = ".RData",
115116
bucket = gcs_get_global_bucket(),
116117
envir = .GlobalEnv,
117118
saveToDisk = file,
119+
generation = NULL,
118120
overwrite = TRUE){
119121

120122
bucket <- as.bucket_name(bucket)
121123

122124
gcs_get_object(file, bucket = bucket,
123-
saveToDisk = saveToDisk, overwrite = overwrite)
125+
saveToDisk = saveToDisk, overwrite = overwrite, generation = generation)
124126
load(saveToDisk, envir = envir)
125127

126128
TRUE

0 commit comments

Comments
 (0)