Skip to content

Commit

Permalink
paws.storage
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Aug 10, 2023
1 parent 1c82f10 commit 92e2aed
Show file tree
Hide file tree
Showing 19 changed files with 78 additions and 78 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Suggests:
nanonext (>= 0.9.0),
rmarkdown (>= 2.4),
parallelly (>= 1.35.0),
paws (>= 0.1.11),
paws.storage (>= 0.2.0),
pingr (>= 2.0.1),
pkgload (>= 1.1.0),
processx (>= 3.4.3),
Expand Down
2 changes: 1 addition & 1 deletion R/class_aws.R
Original file line number Diff line number Diff line change
Expand Up @@ -297,5 +297,5 @@ store_aws_hash <- function(key, bucket, region, endpoint, version, args) {

#' @export
store_get_packages.tar_aws <- function(store) {
c("paws", NextMethod())
c("paws.storage", NextMethod())
}
6 changes: 3 additions & 3 deletions R/class_resources_aws.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ resources_aws_validate_args <- function(args) {
paste(illegal, collapse = ", ")
)
tar_assert_not_in(names, illegal, msg = msg)
client <- paws::s3()
client <- paws.storage::s3()
legal <- c(
names(formals(client$head_object)),
names(formals(client$get_object)),
Expand All @@ -86,12 +86,12 @@ resources_aws_validate_args <- function(args) {
legal <- unique(legal)
msg <- paste(
"informal arguments (via ...) in tar_resources_aws() must be:",
"arguments to paws::s3() functions: head_object(), get_object(),",
"arguments to paws.storage::s3() functions: head_object(), get_object(),",
"delete_object(), put_object(), create_multipart_upload(),",
"abort_multipart_upload(), complete_multipart_upload(),",
"or upload_part(). Documentation of these functions,",
"including lists and explanations of the arguments,",
"are linked from https://paws-r.github.io/docs/s3/"
"are linked from https://www.paws-r-sdk.com/docs/s3"
)
tar_assert_in(names, legal, msg)
}
Expand Down
20 changes: 10 additions & 10 deletions R/tar_resources_aws.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@
#' object versioning turned on, `targets` may fail to record object
#' versions. Google Cloud Storage in particular has this
#' incompatibility.
#' @param ... Named arguments to functions in `paws::s3()` to manage
#' @param ... Named arguments to functions in `paws.storage::s3()` to manage
#' S3 storage. The documentation of these specific functions
#' is linked from <https://paws-r.github.io/docs/s3/>.
#' is linked from <https://www.paws-r-sdk.com/docs/s3>.
#' The configurable functions themselves are:
#' * `paws::s3()$head_object()`
#' * `paws::s3()$get_object()`
#' * `paws::s3()$delete_object()`
#' * `paws::s3()$put_object()`
#' * `paws::s3()$create_multipart_upload()`
#' * `paws::s3()$abort_multipart_upload()`
#' * `paws::s3()$complete_multipart_upload()`
#' * `paws::s3()$upload_part()`
#' * `paws.storage::s3()$head_object()`
#' * `paws.storage::s3()$get_object()`
#' * `paws.storage::s3()$delete_object()`
#' * `paws.storage::s3()$put_object()`
#' * `paws.storage::s3()$create_multipart_upload()`
#' * `paws.storage::s3()$abort_multipart_upload()`
#' * `paws.storage::s3()$complete_multipart_upload()`
#' * `paws.storage::s3()$upload_part()`
#' The named arguments in `...` must not be any of
#' `"bucket"`, `"Bucket"`, `"key"`, `"Key"`,
#' `"prefix"`, `"region"`, `"part_size"`, `"endpoint"`,
Expand Down
2 changes: 1 addition & 1 deletion R/utils_aws.R
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,6 @@ aws_s3_client <- function(endpoint, region) {
if (!is.null(region)) {
config$region <- region
}
paws::s3(config = config)
paws.storage::s3(config = config)
}
# nocov end
20 changes: 10 additions & 10 deletions man/tar_resources_aws.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/aws/test-aws_bad_args.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
tar_test("aws_parquet format returns data frames", {
skip_if_no_aws()
skip_if_not_installed("arrow")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand Down
2 changes: 1 addition & 1 deletion tests/aws/test-aws_custom.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
tar_test("aws with custom format", {
skip_if_no_aws()
skip_if_not_installed("torch")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand Down
2 changes: 1 addition & 1 deletion tests/aws/test-aws_endpoint.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endpoint <- "https://storage.googleapis.com"
region <- "auto"

client <- function() {
paws::s3(
paws.storage::s3(
config = list(
endpoint = endpoint,
region = region
Expand Down
2 changes: 1 addition & 1 deletion tests/aws/test-aws_hpc.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# And afterwards, manually verify that all the buckets are gone.
tar_test("AWS S3 + HPC", {
skip_if_no_aws()
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand Down
10 changes: 5 additions & 5 deletions tests/aws/test-class_aws_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
tar_test("aws file gets stored", {
skip_if_no_aws()
bucket_name <- random_bucket_name()
s3 <- paws::s3()
s3 <- paws.storage::s3()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
expr <- quote({
Expand Down Expand Up @@ -55,7 +55,7 @@ tar_test("aws file gets stored", {
tar_test("aws file gets stored with transient memory", {
skip_if_no_aws()
bucket_name <- random_bucket_name()
s3 <- paws::s3()
s3 <- paws.storage::s3()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
expr <- quote({
Expand Down Expand Up @@ -110,7 +110,7 @@ tar_test("aws file gets stored with transient memory", {
# and then four times for transient.
tar_test("aws_file format invalidation", {
skip_if_no_aws()
s3 <- paws::s3()
s3 <- paws.storage::s3()
for (memory in c("persistent", "transient")) {
# print(memory) # Uncomment for debug() test. # nolint
bucket_name <- random_bucket_name()
Expand Down Expand Up @@ -185,7 +185,7 @@ tar_test("aws_file format with a custom data store", {
skip_if_no_aws()
tar_config_set(store = "custom_targets_store")
bucket_name <- random_bucket_name()
s3 <- paws::s3()
s3 <- paws.storage::s3()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
expr <- quote({
Expand Down Expand Up @@ -235,7 +235,7 @@ tar_test("aws_file format with a custom data store", {
tar_test("aws_file format file with different region", {
skip_if_no_aws()
bucket_name <- random_bucket_name()
s3 <- paws::s3()
s3 <- paws.storage::s3()
region <- "us-west-2"
cfg <- list(LocationConstraint = region)
s3$create_bucket(Bucket = bucket_name, CreateBucketConfiguration = cfg)
Expand Down
2 changes: 1 addition & 1 deletion tests/aws/test-class_aws_parquet.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
tar_test("aws_parquet format returns data frames", {
skip_if_no_aws()
skip_if_not_installed("arrow")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand Down
24 changes: 12 additions & 12 deletions tests/aws/test-class_aws_qs.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
tar_test("aws_qs format data gets stored", {
skip_if_no_aws()
skip_if_not_installed("qs")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
on.exit(aws_s3_delete_bucket(bucket_name))
s3$create_bucket(Bucket = bucket_name)
Expand Down Expand Up @@ -43,7 +43,7 @@ tar_test("aws_qs format data gets stored", {
tar_test("aws_qs format data gets stored with worker storage", {
skip_if_no_aws()
skip_if_not_installed("qs")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand Down Expand Up @@ -85,7 +85,7 @@ tar_test("aws_qs format data gets stored with worker storage", {
tar_test("aws_qs format invalidation", {
skip_if_no_aws()
skip_if_not_installed("qs")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand Down Expand Up @@ -132,7 +132,7 @@ tar_test("aws_qs format invalidation", {
tar_test("aws_qs format and dynamic branching", {
skip_if_no_aws()
skip_if_not_installed("qs")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand Down Expand Up @@ -164,7 +164,7 @@ tar_test("aws_qs format and dynamic branching", {
tar_test("aws timestamp", {
skip_if_no_aws()
skip_if_not_installed("qs")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand Down Expand Up @@ -195,7 +195,7 @@ tar_test("aws_qs format with an alternative data store", {
skip_if_no_aws()
skip_if_not_installed("qs")
tar_config_set(store = "custom_targets_store")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand Down Expand Up @@ -235,7 +235,7 @@ tar_test("aws_qs format with an alternative data store", {
tar_test("aws_qs format works with storage = \"none\"", {
skip_if_no_aws()
skip_if_not_installed("qs")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand Down Expand Up @@ -281,7 +281,7 @@ tar_test("aws_qs format works with storage = \"none\"", {
tar_test("aws_qs format with custom region", {
skip_if_no_aws()
skip_if_not_installed("qs")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
region <- "us-west-2"
cfg <- list(LocationConstraint = region)
Expand Down Expand Up @@ -343,7 +343,7 @@ tar_test("aws_qs format with custom region", {
tar_test("aws_qs format empty region string", {
skip_if_no_aws()
skip_if_not_installed("qs")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand All @@ -367,7 +367,7 @@ tar_test("aws_qs format empty region string", {
tar_test("aws_qs nonexistent bucket", {
skip_if_no_aws()
skip_if_not_installed("qs")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
expr <- quote({
Expand Down Expand Up @@ -399,7 +399,7 @@ tar_test("aws_qs format versioning", {
# setup
skip_if_no_aws()
skip_if_not_installed("qs")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
on.exit(aws_s3_delete_bucket(bucket_name))
s3$create_bucket(Bucket = bucket_name)
Expand Down Expand Up @@ -477,7 +477,7 @@ tar_test("aws_qs format versioning", {
tar_test("cloud target paths are not in the file path cache", {
skip_if_no_aws()
skip_if_not_installed("qs")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
on.exit(aws_s3_delete_bucket(bucket_name))
s3$create_bucket(Bucket = bucket_name)
Expand Down
8 changes: 4 additions & 4 deletions tests/aws/test-delete.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
tar_test("delete cloud targets", {
skip_if_no_aws()
skip_if_not_installed("arrow")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand Down Expand Up @@ -57,7 +57,7 @@ tar_test("delete cloud targets", {
tar_test("same with versioning", {
skip_if_no_aws()
skip_if_not_installed("arrow")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
s3$put_bucket_versioning(
Expand Down Expand Up @@ -117,7 +117,7 @@ tar_test("same with versioning", {
tar_test("tar_destroy() cloud targets", {
skip_if_no_aws()
skip_if_not_installed("arrow")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand Down Expand Up @@ -172,7 +172,7 @@ tar_test("tar_destroy() cloud targets", {
tar_test("tar_prune(), tar_exist_objects(), and tar_objects() for aws", {
skip_if_no_aws()
skip_if_not_installed("arrow")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand Down
6 changes: 3 additions & 3 deletions tests/aws/test-deprecated.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
tar_test("AWS S3 with old resources", {
skip_if_no_aws()
bucket_name <- random_bucket_name()
s3 <- paws::s3()
s3 <- paws.storage::s3()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
code <- substitute({
Expand Down Expand Up @@ -37,7 +37,7 @@ tar_test("AWS S3 with old resources", {
tar_test("deprecated format = \"aws_parquet\"", {
skip_if_no_aws()
skip_if_not_installed("arrow")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand Down Expand Up @@ -65,7 +65,7 @@ tar_test("deprecated format = \"aws_parquet\"", {
tar_test("migrate meta database", {
skip_if_no_aws()
skip_if_not_installed("arrow")
s3 <- paws::s3()
s3 <- paws.storage::s3()
bucket_name <- random_bucket_name()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
Expand Down
2 changes: 1 addition & 1 deletion tests/aws/test-prefix.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tar_test("aws_parquet format returns data frames", {
skip_if_no_aws()
skip_if_not_installed("arrow")
bucket_name <- random_bucket_name()
s3 <- paws::s3()
s3 <- paws.storage::s3()
s3$create_bucket(Bucket = bucket_name)
on.exit(aws_s3_delete_bucket(bucket_name))
expr <- quote({
Expand Down
Loading

0 comments on commit 92e2aed

Please sign in to comment.