From 160ce4b321e5cbde092081c81c777fbf057629f4 Mon Sep 17 00:00:00 2001 From: paul bochtler <65470117+datapumpernickel@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:12:19 +0200 Subject: [PATCH 1/4] Add missing file conversion size parameter for B which created missings and errors --- R/ct_process_response.R | 3 ++- R/utils.R | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/R/ct_process_response.R b/R/ct_process_response.R index 6ba3b0b..53da327 100644 --- a/R/ct_process_response.R +++ b/R/ct_process_response.R @@ -17,7 +17,8 @@ ct_process_response <- if (bulk) { if (!dir.exists(tools::R_user_dir('comtradr_bulk',which = 'cache'))) { - dir.create(tools::R_user_dir('comtradr_bulk',which = 'cache'), recursive = TRUE) + dir.create(tools::R_user_dir('comtradr_bulk',which = 'cache'), + recursive = TRUE) } filename <- httr2::resp_header(resp, "Content-Disposition") |> stringr::str_remove('.*filename="') |> diff --git a/R/utils.R b/R/utils.R index 225b755..b4728b1 100644 --- a/R/utils.R +++ b/R/utils.R @@ -467,7 +467,7 @@ replace_month <- function(date_str) { #' #' @noRd convert_file_size <- function(file_sizes) { - units <- c(KB = 1024, MB = 1024^2, GB = 1024^3, TB = 1024^4) + units <- c(B = 1, KB = 1024, MB = 1024^2, GB = 1024^3, TB = 1024^4) sapply(file_sizes, function(x) { parts <- strsplit(x, " ")[[1]] number <- as.numeric(parts[1]) From 5151ca87f643d43590932db98b644e7fa27736b0 Mon Sep 17 00:00:00 2001 From: paul bochtler <65470117+datapumpernickel@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:15:12 +0200 Subject: [PATCH 2/4] Increment version number to 1.0.2 --- DESCRIPTION | 2 +- NEWS.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5f1131a..1fabe09 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: comtradr Title: Interface with the United Nations Comtrade API -Version: 1.0.1 +Version: 1.0.2 Maintainer: Paul Bochtler Authors@R: c( person("Paul", "Bochtler", diff --git a/NEWS.md b/NEWS.md index e968c1b..9720052 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# comtradr 1.0.2 + # comtradr 1.0.1 * this is a patch to fix a CRAN policy violation, namely that the cache was written in the wrong directory due to using rappdirs. From 244124a9352aa86c26831fa9e48b3e7ed34126f3 Mon Sep 17 00:00:00 2001 From: paul bochtler <65470117+datapumpernickel@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:17:19 +0200 Subject: [PATCH 3/4] update news.md --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index 9720052..15d3b65 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # comtradr 1.0.2 +* this is a patch to fix two bugs in the package: + * a missing return in the fcall to tidy_cols did not allow users to set this argument to false, see https://github.com/ropensci/comtradr/issues/88 (thanks @FATelarico) + * a missing parameter in the file size conversion function did not allow the bulk facility to download small files. This has been fixed. + # comtradr 1.0.1 * this is a patch to fix a CRAN policy violation, namely that the cache was written in the wrong directory due to using rappdirs. From b42ed89cf9ca57434b0087f8d58029f31a00fb64 Mon Sep 17 00:00:00 2001 From: paul bochtler <65470117+datapumpernickel@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:20:43 +0200 Subject: [PATCH 4/4] reference commit in news.md --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 15d3b65..a95e89d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,7 @@ # comtradr 1.0.2 * this is a patch to fix two bugs in the package: - * a missing return in the fcall to tidy_cols did not allow users to set this argument to false, see https://github.com/ropensci/comtradr/issues/88 (thanks @FATelarico) + * a missing return in the fcall to tidy_cols did not allow users to set this argument to false, see https://github.com/ropensci/comtradr/issues/88 and commit 6f34592 (thanks @FATelarico) * a missing parameter in the file size conversion function did not allow the bulk facility to download small files. This has been fixed. # comtradr 1.0.1