Skip to content

Commit 8008a89

Browse files
committed
Add detailed information to warning message
1 parent 49bfb4d commit 8008a89

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

R-packages/covidcast/R/covidcast.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,18 @@ covidcast_days <- function(data_source, signal, start_day, end_day, geo_type,
499499
nrow(dat[[i]]$epidata)))
500500
if (dat[[i]]$message == "success") {
501501
returned_geo_values <- dat[[i]]$epidata$geo_value
502-
missed_geos <- setdiff(geo_value, returned_geo_values)
502+
missed_geos <- setdiff(tolower(geo_value), tolower(returned_geo_values))
503503
if (length(missed_geos) > 0) {
504504
missed_geos_str <- paste0(missed_geos, collapse = ", ")
505505
warn(message =
506506
sprintf("Data not fetched for some geographies on %s: %s",
507-
query_day, missed_geos_str)
507+
query_day, missed_geos_str),
508+
data_source = data_source,
509+
signal = signal,
510+
day = query_day,
511+
geo_value = geo_value,
512+
msg = dat[[i]]$message,
513+
class = "covidcast_missing_geo_values"
508514
)
509515
}
510516
} else {

0 commit comments

Comments
 (0)