Skip to content

Commit

Permalink
Merge pull request #91 from ropensci/dev
Browse files Browse the repository at this point in the history
patch to version 1.0.2
  • Loading branch information
datapumpernickel authored Sep 19, 2024
2 parents 5792428 + b42ed89 commit 900ec18
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 <paulbochtler.gh@gmail.com>
Authors@R: c(
person("Paul", "Bochtler",
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +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 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

* this is a patch to fix a CRAN policy violation, namely that the cache was written in the wrong directory due to using rappdirs.
Expand Down
3 changes: 2 additions & 1 deletion R/ct_process_response.R
Original file line number Diff line number Diff line change
Expand Up @@ -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="') |>
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 900ec18

Please sign in to comment.