Skip to content

Commit

Permalink
Update R/get_latest_resource_id.R
Browse files Browse the repository at this point in the history
Co-authored-by: James McMahon <[email protected]>
  • Loading branch information
ross-hull and Moohan authored Jul 16, 2024
1 parent 5d07f46 commit 18172c2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions R/get_latest_resource_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,10 @@ get_latest_resource_id <- function(dataset_name) {
all_id_data_first_row <- all_id_data %>%
dplyr::slice(1)

# if the resource at the top as appearing on the open data platform also has the most
# recent date created, return it. Otherwise return warning
# If the resource at the top as appearing on the open data platform also has the most
# recent date created, return it. Otherwise, error
if (all_id_data_first_row$created_date == all_id_data_first_row$most_recent_date_created) {
return(all_id_data_first_row$id)
} else {
(warning("most recent id could not be identified"))
}
}
cli::cli_abort("The most recent id could not be identified"))
}

0 comments on commit 18172c2

Please sign in to comment.