Skip to content

Commit

Permalink
Merge pull request #48 from economic-analytics/automate-other-datasets
Browse files Browse the repository at this point in the history
Automate other datasets
  • Loading branch information
ChristianSpence authored Sep 11, 2024
2 parents 3499d89 + 4fea13c commit 290ab14
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 53 deletions.
2 changes: 2 additions & 0 deletions .pipelines/run_ons_update.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ check_next_update_dates()
pkgload::load_all()

ons_update_datasets()

update_other_datasets()
15 changes: 15 additions & 0 deletions R/data-ons-update-others.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
other_datasets_to_update <- function() {
edd_dict |>
dplyr::filter(
status,
!is.na(func),
next_update <= Sys.Date() &
next_update >= last_download
)
}

update_other_datasets <- function() {
for (dataset in other_datasets_to_update()$id) {
eval(call(edd_dict$func[edd_dict$id == dataset]))
}
}
Loading

0 comments on commit 290ab14

Please sign in to comment.