Skip to content

Commit 3f24f3f

Browse files
authored
Update NSSP Local Option In Update Target Data Script To Support Parquet Files (#64)
1 parent d0bfb69 commit 3f24f3f

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

R/update_hub_target_data.R

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,21 @@ update_hub_target_data <- function(
9595
}
9696

9797
if (nssp_update_local) {
98-
raw_nssp_data <- forecasttools::read_tabular(
99-
fs::path(
100-
base_hub_path,
101-
"auxiliary-data",
102-
"nssp-raw-data",
103-
"latest",
104-
ext = "csv"
98+
nssp_file_path <- fs::path(
99+
base_hub_path,
100+
"auxiliary-data",
101+
"nssp-raw-data",
102+
"latest",
103+
ext = "parquet"
104+
)
105+
106+
if (!fs::file_exists(nssp_file_path)) {
107+
cli::cli_abort(
108+
glue::glue("Cannot find NSSP data file at {nssp_file_path}")
105109
)
106-
) |>
110+
}
111+
112+
raw_nssp_data <- forecasttools::read_tabular(nssp_file_path) |>
107113
dplyr::filter(.data$county == "All") |>
108114
dplyr::select(
109115
"week_end",

0 commit comments

Comments
 (0)