Skip to content

feat: support geo_values (single geo_type) #237

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 2 commits into from
Oct 9, 2020
Merged

feat: support geo_values (single geo_type) #237

merged 2 commits into from
Oct 9, 2020

Conversation

sgratzl
Copy link
Member

@sgratzl sgratzl commented Oct 7, 2020

closes #221 (single geo type only for now)

add support for geo_values.

valid variants:

  • geo_value=*
  • geo_value=CA
  • geo_values=CA,NY

@krivard krivard self-requested a review October 8, 2020 19:01
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.

Everything builds, tests pass, just added note so we don't forget about partial-failures when we fix #195

Comment on lines +401 to +403
r = fetch(['11111', '55555'])
self.assertEqual(r['message'], 'success')
self.assertEqual(r['epidata'], [counties[0]])
Copy link
Contributor

Choose a reason for hiding this comment

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

This is probably the right choice (silently omit bogus geo values from the response) but we should revisit it when we figure out deletion encoding. One of the goals of deletion encoding is to start giving better feedback about "you asked for a bogus county" vs "that information was withheld for privacy reasons", and an error on parts of a query might have to be treated carefully.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it behaves the same way for all kind of parameters that are not existing, e.g., if you specify a wrong data source you just get no results back but it doesn't throw an error. That is the current nature of just generating a where clause

@krivard krivard requested a review from sgsmob October 8, 2020 20:41
// the wildcard query should return data for all locations in `geo_type`
$condition_geo_value = 'TRUE';
} else if (is_array($geo_values)) {
// return data for multiple location
$condition_geo_value = filter_strings('t.`geo_value`', $geo_values);
} else {
// return data for a particular location
Copy link
Contributor

Choose a reason for hiding this comment

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

If a '*' is present in the list will it be interpreted literally (matching geo_values that are '*')?

Copy link
Member Author

Choose a reason for hiding this comment

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

atm. yes, there is the clear distinction see PR comment about the variants

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

Successfully merging this pull request may close these issues.

Accept a list of geo_values instead of only a single value
3 participants