Skip to content

Commit 5fb86a4

Browse files
committed
enh: pub_covidcast errors when time_type not day or week
* nssp errors when time_type not week
1 parent 7ddb1b6 commit 5fb86a4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

R/endpoints.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,17 @@ pub_covidcast <- function(
10401040
)
10411041
}
10421042

1043+
if (source == "nssp" && time_type != "week") {
1044+
cli::cli_abort(
1045+
"{source} data is only available at the week level",
1046+
class = "epidatr__nchs_week_only"
1047+
)
1048+
}
1049+
1050+
# TODO: This should probably be done in the create_epidata_call function. But
1051+
# this is a quick fix for now.
1052+
checkmate::assert_subset(time_type, c("day", "week"))
1053+
10431054
create_epidata_call(
10441055
"covidcast/",
10451056
list(

0 commit comments

Comments
 (0)