datacommonsorg / api-python

Python client library to access Data Commons
https://www.datacommons.org
Apache License 2.0
70 stars 39 forks source link

Batch get_stat_all calls if more than QUERY_BATCH_SIZE places. #155

Closed tjann closed 4 years ago

tjann commented 4 years ago

Before code changes:

Screen Shot 2020-09-08 at 10 03 14 AM

After code changes: Screen Shot 2020-09-08 at 10 04 51 AM

tjann commented 4 years ago

I was on the fence between doing lenient key error handling or throwing errors if REST response didn't follow the expectations.

The former might be nice for us to have more time to fix issues when REST changes, but also makes it difficult for us to know when something is wrong. So I opted for the latter in the spirit of failing fast.

beets commented 4 years ago

The error handling here seems reasonable to me, since those are truly errors that should get looked at (and isn't a matter of a 1 missing data out of 1000 calls).

tjann commented 4 years ago

Thanks all for the review!