Skip to content

Commit

Permalink
Corrected typo in variable name and added missing mock for get_respon…
Browse files Browse the repository at this point in the history
…se_headers
  • Loading branch information
chriscarrollsmith committed Dec 7, 2024
1 parent 2f34b0e commit 6f86aa4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/ids_get.R
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ validate_progress <- function(progress) {

# to be updated manually with each release
# for the 2024-12 IDS release:
latest_year_observied <- 2023
latest_year_observed <- 2023
latest_year_projections <- 2031

create_time <- function(start_date, end_date) {
Expand All @@ -269,13 +269,13 @@ create_time <- function(start_date, end_date) {
filter_post_actual_na <- function(data) {
# Identify rows after the latest actual year
data_after_actual <- data |>
filter(.data$year > latest_year_observied)
filter(.data$year > latest_year_observed)

# Check if all rows for these years have NA in `value`
if (all(is.na(data_after_actual$value))) {
# Remove these rows from the data
data <- data |>
filter(.data$year <= latest_year_observied)
filter(.data$year <= latest_year_observed)
}

data
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-ids_bulk.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ test_that("ids_bulk handles custom file paths", {
},
process_bulk_data = function(...) {
tibble::tibble()
},
get_response_headers = function(...) {
list(`content-length` = 1000)
}
)

Expand Down

0 comments on commit 6f86aa4

Please sign in to comment.