From d4e1d53c29f782786c0b53164e48812bc85e4358 Mon Sep 17 00:00:00 2001 From: alice-hannah Date: Wed, 14 Jan 2026 15:47:10 +0000 Subject: [PATCH 1/4] Add trailing forward slash to URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6cf1c34..36b503f 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ library(objr) ``` Help files for each function in the package can be found on the -[References](https://ScotGovAnalysis.github.io/objr/reference) page of the package website. Alternatively, type `?function_name` into the +[References](https://ScotGovAnalysis.github.io/objr/reference/) page of the package website. Alternatively, type `?function_name` into the RStudio console. For example: ``` r From a5846f425998e47ff38d96c80eddfa524fb403e3 Mon Sep 17 00:00:00 2001 From: alice-hannah Date: Wed, 14 Jan 2026 16:51:27 +0000 Subject: [PATCH 2/4] Polish news --- NEWS.md | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/NEWS.md b/NEWS.md index 4e2338a..39c47df 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,35 +1,39 @@ # objr (development version) -* Added `CONTRIBUTING.md` and `SUPPORT.md` (#36). +## New features -* `download_file()` now returns file path (invisibly) (#38). - -* `download_file()` now accepts custom file name in `file_name` argument (#37). +* New `mobile_auth_status()` and `mobile_auth_login()` support use of +[mobile authentication](https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/MobileAuth) +(#52). -* `download_file()` now writes files with percent-decoded names -(e.g. `file%20name.csv` is now `file name.csv`) (#34). +* New `workgroup_mandate_2fa()` provides ability to enable or disable mandatory +two-factor authentication (2FA) in workgroups (#65). -* Fixed an issue where temporary files sometimes persisted after running -`download_file()` or `read_data()` (#39). +* `read_data()` and `write_data()` now support reading and writing of parquet +files (#54). -* Added support for parquet files in `read/write_data` and -`read/write_data_version()`(#54). +* `download_file()` gains a `file_name` argument to supply a custom name (#37). -* Added support for [mobile authentication](https://secure.objectiveconnect.co.uk/publicapi/1/swagger-ui/index.html?configUrl=/publicapi/1/v3/api-docs/swagger-config#/MobileAuth) -to view status (`mobile_auth_staus()`) and to login (`mobile_auth_login()`) -(#52). +## Lifecycle changes * In `assets()`, `type` now expects a string instead of a list. This was prompted by a change to the underlying API, where results can now only be filtered by one asset type at a time (#53). -* New `workgroup_mandate_2fa()` provides ability to enable or disable mandatory -two-factor authentication (2FA) in workgroups (#65). +## Minor improvements and bug fixes * Expiry time is now stored alongside the authentication token (`token`). If a token is expired, it will be removed from the Global Environment and authentication will be attempted with username and password instead (#35). +* `download_file()` now returns file path (invisibly) (#38). + +* `download_file()` now writes files with percent-decoded names +(e.g. `file%20name.csv` is now `file name.csv`) (#34). + +* Fixed an issue where temporary files sometimes persisted after running +`download_file()` or `read_data()` (#39). + # objr 0.1.1 * Set minimum versions for `dplyr` and `tidyr` dependencies (#32). From 6e93ec2e20f11dc19ff7a83c3b6165eb8584d9d8 Mon Sep 17 00:00:00 2001 From: alice-hannah Date: Wed, 14 Jan 2026 17:30:33 +0000 Subject: [PATCH 3/4] Add tz arg to `convert_from_epoch` --- R/utils.R | 5 ++++- tests/testthat/test-utils.R | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/R/utils.R b/R/utils.R index be920e4..649676a 100644 --- a/R/utils.R +++ b/R/utils.R @@ -287,6 +287,8 @@ convert_to_epoch <- function(date_time, #' Convert number of milliseconds to epoch to date or datetime object #' #' @param x Numeric. +#' @param tz Character string, passed to `as.POSIXct`. Default value of "" uses +#' current time zone. #' #' @details If NULL is supplied, NULL is returned. #' @@ -298,6 +300,7 @@ convert_to_epoch <- function(date_time, #' @noRd convert_from_epoch <- function(x, + tz = "", error_arg = rlang::caller_arg(x), error_call = rlang::caller_env()) { @@ -313,6 +316,6 @@ convert_from_epoch <- function(x, ) } - as.POSIXct(x / 1000, origin = "1970-01-01") + as.POSIXct(x / 1000, origin = "1970-01-01", tz = tz) } diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 1787836..20bb56a 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -207,12 +207,12 @@ test_that("Error produced if not NULL or POSIXct", { test_that("Correct value returned", { expect_equal( - convert_to_epoch(as.POSIXct("2024-01-01 09:00:00")), + convert_to_epoch(as.POSIXct("2024-01-01 09:00:00", tz = "GMT")), 1704099600000 ) expect_equal( - convert_to_epoch(as.POSIXct("2024-01-01")), + convert_to_epoch(as.POSIXct("2024-01-01", tz = "GMT")), 1704067200000 ) @@ -234,8 +234,8 @@ test_that("Error produced if not NULL or numeric", { test_that("Correct value returned", { expect_equal( - convert_from_epoch(1704099600000), - as.POSIXct("2024-01-01 09:00:00") + convert_from_epoch(1704099600000, tz = "GMT"), + as.POSIXct("2024-01-01 09:00:00", tz = "GMT") ) expect_equal(convert_from_epoch(NULL), NULL) From f9518693d14550191b3ee7bf06ff162f2aba44db Mon Sep 17 00:00:00 2001 From: alice-hannah Date: Wed, 14 Jan 2026 17:42:51 +0000 Subject: [PATCH 4/4] Increment version number to 0.2.0 --- DESCRIPTION | 2 +- NEWS.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 8c4f954..d2f0c4a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: objr Title: Wrapper for Objective APIs -Version: 0.1.1.9000 +Version: 0.2.0 Authors@R: c( person("Scottish Government", , , "statistics.enquiries@gov.scot", role = "cph"), person("Alice", "Hannah", , "alice.hannah@gov.scot", role = c("aut", "cre")) diff --git a/NEWS.md b/NEWS.md index 39c47df..cd724fc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# objr (development version) +# objr 0.2.0 ## New features