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

HOTFIX: Point hospitalization data scraper to new CHHS API resource #191

Merged
merged 1 commit into from
Mar 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions covid19_sfbayarea/data/hospitals.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@


# URLs and APIs
HOSPITALS_LANDING_PAGE = "https://data.ca.gov/dataset/covid-19-hospital-data#"
CAGOV_BASEURL = "https://data.ca.gov"
HOSPITALS_RESOURCE_ID = "42d33765-20fd-44b8-a978-b083b7542225"
HOSPITALS_LANDING_PAGE = "https://data.chhs.ca.gov/dataset/covid-19-hospital-data"
CAGOV_BASEURL = "https://data.chhs.ca.gov"
HOSPITALS_RESOURCE_ID = "47af979d-8685-4981-bced-96a6b79d3ed5"
RESULTS_LIMIT = 200

# For the output data
Expand Down Expand Up @@ -71,7 +71,12 @@ def floats_to_ints(record: Dict) -> Dict:
continue

else:
record[field] = int(val)
try:
record[field] = int(val)

except ValueError:
# Handle floats stored as strings
record[field] = int(float(val))

return record

Expand Down