Closed lahdjirayhan closed 2 years ago
@lahdjirayhan Absolutely! This is something that definitely occurred to me before, but I didn't give it enough thought. The use case that you mentioned of dozens of cities (or more) is certainly one that would be annoying without this.
I think it's a badly needed improvement. Excited that the tests are helping so much! Thanks again for making such a robust set of tests.
As laid out by the tests,
get_multiple_*_air
methods shouldn't halt when there is one bad input. One bad input (which in turn will make backend return error/bad response, which will make an exception raised in our part) shouldn't halt the execution of other, likely good, inputs. This is not convenient. For what it's worth, I've always treatedget_multiple_*
methods as convenience wrappers for their singleget_*_air
counterparts (otherwise I could just loop them myself).The example in my mind is this: you are mass-collecting data for a hundred cities. One city turns out to not have AQI station and subsequently raise exception (you likely won't know this in advance). It will be annoying to have the other 99 cities halted.
I realize that this will make an odd difference between e.g.
get_city_air
(raises exception on bad response) andget_multiple_cities_air
(returns nan row on bad response). I don't have really much to say either supporting or against.Is this a good or common enough use case? Should I implement things differently? I'm curious to hear more.