-
Notifications
You must be signed in to change notification settings - Fork 67
new data source: covid hospitalization #292
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
Conversation
sync to delphi
sync to delphi
- nothing here is deployed in prod or runs in prod - this will be used by unit and integration tests later on - including some realistic sample data to fully exercise all the code paths - also includes readme with basic source info and plan for acquisition
- extract out all the parts that make network calls - this class will be swapped out with a mock in unit and integration tests to prevent hitting real external services during testing - tests included
- extract out all the database interactions - this will be mocked out in unit tests (but not integration tests, as they will interact with a real (local) database) - implemented as a context manager which ensures graceful cleanup on both success and failure - care is taken to only commit transaction on success - ddl included (this will require a one-time manual run on the server) - tests included
- checks for new data - bails if nothing new, otherwise fetches and stores in database - tested using mocks for database and network operations, using sample data for more realistic testing - this should be scheduled in automation, suggest 1-2 times per day `python3 -m delphi.epidata.acquisition.covid_hosp.update`
- after this commit, acquisition can be scheduled in automation
- just another data source, following all the same conventions as before - wow there are so many columns in this dataset... - tests to follow shortly, after the api clients are updated
- updates all the client libraries - coffee recompiled to js using latest version of coffeescript
- tests server-side api behavior, like handling of versioning (issues) - tests acquisition "pipeline", which uses test data to download and store a dataset
- adds new page for the `covid_hosp` endpoint - adds entry in the parent readme for this new covid-19 data source
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfinished review; will hit the other files later
committing suggestion from @krivard Co-authored-by: Katie Mazaitis <[email protected]>
- use built-in fuzzy comparison instead of taking abs and less than
- these names aren't actually changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a new javascript client (otherwise it will fail deployment on prod) but everything else is probably optional
dont hardcode column count Co-authored-by: Katie Mazaitis <[email protected]>
- line was too long, split up
- converted from es6 to es5 by babel
@krivard thanks for the review, should be good to go! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Adds a new data source to the API, start to finish.
"COVID-19 Reported Patient Impact and Hospital Capacity by State Timeseries" dataset provided by the US Department of
Health & Human Services via healthdata.gov.
https://healthdata.gov/dataset/covid-19-reported-patient-impact-and-hospital-capacity-state-timeseries
Fixes #288
See individual commits for more details on what happens at each step.
covid_hosp
to api serverrepo-wide unit tests: ✔ All 52 tests passed!
repo-wide integration tests: ✔ All 29 tests passed!