You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of handling region-checking on the interface client side, can we handle it here?
When i try region = "taiwan" with both ecdc_ili (Europe) and kcdc_ili (Korea) through epidatr, I get epidata warning: no results and an empty tibble. But I'm pretty sure that this region is invalid. It seems like this query should error instead of returning an empty result, which implies that the query was valid
Ideally the error would say that the requested region is invalid, with more info about how to provide a valid region name.
covidcast does error with invalid geo_values, although the error is sub-optimal (this is with an API key set).
> covidcast::covidcast_signal("jhu-csse", "confirmed_cumulative_num", geo_type = "state", geo_values = "zz")
Error in .request("covidcast", params) :
Bad Request (HTTP 400). Failed to fetch data from API anonymously.
The text was updated successfully, but these errors were encountered:
(I'm not sure what you mean by "interface side", and i would guess you mean "client side", but i also suppose it doesn't actually matter for this...)
The covidcast endpoint is easily the most full-featured and complex of all our endpoints. It uses delphi_utils.GeoMapper to identify [il]legitimate locations, and it does some other input validation for other fields too. On the other hand, ecdc_ili and kcdc_ili are much "leaner" endpoints that don't do much more than translate an http request to a database query. That doesn't mean they can't be augmented to validate their inputs too, but its not a simple drop-in replacement especially because GeoMapper will not cover European or Asian locations.
For what its worth, your example invalid-geo covidcast request would've gotten this reply from the covidcast api web server:
{"epidata": [], "message": "Invalid geo_value(s) zz for the requested geo_type state", "result": -1}
Instead of handling region-checking on the
interfaceclient side, can we handle it here?When i try
region = "taiwan"
with bothecdc_ili
(Europe) andkcdc_ili
(Korea) throughepidatr
, I getepidata warning: no results
and an empty tibble. But I'm pretty sure that this region is invalid. It seems like this query should error instead of returning an empty result, which implies that the query was validIdeally the error would say that the requested region is invalid, with more info about how to provide a valid region name.
covidcast
does error with invalidgeo_values
, although the error is sub-optimal (this is with an API key set).The text was updated successfully, but these errors were encountered: