Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ... to s3_upload_yaml to fix issue noted in #625 #652

Merged
merged 2 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
* Increased datetime precision to the second, for `pin_versions()` and related
functions (#642, @tomsing1).

* Pass the dots from `pin_write()` through to `s3_upload_file()` to support
S3 tagging, encryption options, etc for pins (#648).
* Pass the dots from `pin_write()` through to `s3_upload_file()` and
`s3_uploade_yaml()` to support S3 tagging, encryption options, etc for
pins (#648, #652, @fh-mthomson).

# pins 1.0.2

Expand Down
7 changes: 4 additions & 3 deletions R/board_s3.R
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ pin_store.pins_board_s3 <- function(board, name, paths, metadata,
version <- version_setup(board, name, version_name(metadata), versioned = versioned)

version_dir <- fs::path(name, version)
s3_upload_yaml(board, fs::path(version_dir, "data.txt"), metadata)
s3_upload_yaml(board, fs::path(version_dir, "data.txt"), metadata, ...)
for (path in paths) {
s3_upload_file(board, fs::path(version_dir, fs::path_file(path)), path, ...)
}
Expand Down Expand Up @@ -265,12 +265,13 @@ s3_delete_dir <- function(board, dir) {
invisible()
}

s3_upload_yaml <- function(board, key, yaml) {
s3_upload_yaml <- function(board, key, yaml, ...) {
body <- charToRaw(yaml::as.yaml(yaml))
board$svc$put_object(
Bucket = board$bucket,
Key = paste0(board$prefix, key),
Body = body
Body = body,
...
)
}

Expand Down