Skip to content

Commit

Permalink
add ... to s3_upload_yaml to fix issue noted in #625 (#652)
Browse files Browse the repository at this point in the history
* add ... to s3_upload_yaml to fix issue when per #625

* Update NEWS

Co-authored-by: Julia Silge <[email protected]>
  • Loading branch information
fh-mthomson and juliasilge authored Sep 12, 2022
1 parent 7379792 commit 97b5614
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
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

0 comments on commit 97b5614

Please sign in to comment.