Skip to content

Fix covid hosp as_of to only return latest issue #602

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

Merged
merged 3 commits into from
Jun 18, 2021
Merged

Conversation

chinandrew
Copy link
Contributor

@chinandrew chinandrew commented Jun 17, 2021

closes

Prerequisites:

  • Unless it is a documentation hotfix it should be merged against the dev branch
  • Branch is up-to-date with the branch to be merged with, i.e. dev
  • Build is successful
  • Code is cleaned up and formatted

Summary

Bug fix: Previously as_of was returning all isues <= as_of date. This changes it to only return the latest issue <= as_of date

@chinandrew chinandrew requested a review from krivard June 17, 2021 17:52
with self.subTest(name='as_of with multiple issues'):
response = Epidata.covid_hosp('PA', 20201118, as_of=20201103)
self.assertEqual(response['result'], 1)
self.assertEqual(len(response['epidata']), 1)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the test that will fail with the old code, since it returns a length of 3.

krivard
krivard previously approved these changes Jun 17, 2021
Copy link
Contributor

@krivard krivard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, otherwise 👍

@sgratzl sgratzl added api change affect the API and its responses bug labels Jun 18, 2021
Copy link
Contributor

@krivard krivard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@krivard krivard merged commit 8fd0d55 into dev Jun 18, 2021
@krivard krivard deleted the covidhosp_asof_fix branch June 18, 2021 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api change affect the API and its responses bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants