Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Produce helpful error message when requesting an unsupported or unavailable geo_type or time_type in Epidata$covidcast #640

Open
brookslogan opened this issue Jul 15, 2021 · 1 comment

Comments

@brookslogan
Copy link
Contributor

brookslogan commented Jul 15, 2021

Epidata$covidcast("nchs-mortality","deaths_allcause_incidence_num","epiweek","state",202101,"ca")

and

Epidata$covidcast("jhu-csse","confirmed_incidence_num","week","state",202101,"ca")

and

Epidata$covidcast("jhu-csse","confirmed_incidence_num","day","sstate",20210101,"ca")

all produce

$result
[1] -2

$message
[1] "no results"

The first query requested "epiweek" data rather than "week" data, the second requested "week" data when the source&signal does not have any available, and the third contained a typo in the geo_type.

It would be nice to have messages along the lines of:

  • "invalid time_type"
  • "requested signal does not support the requested time_type and geo_type"
  • "invalid geo_type"
@melange396
Copy link
Collaborator

If we want to handle this client-side, available time_types and geo_types for each signal can be found via the "metadata" endpoint(s). They are enumerated as part of the metadata generation, and this information is recomputed regularly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants