-
Notifications
You must be signed in to change notification settings - Fork 10
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
Errors are not properly raised when df = True #10
Comments
Similar error when the API is not returning any data, resulting in a For example: api.measurements(
city='Delhi',
parameter='pm25',
location='Anand Vihar',
limit=5,
df=False) returns
Whereas api.measurements(
city='Delhi',
parameter='pm25',
location='Anand Vihar',
limit=5,
df=True) in
Would it be an option if I try to provide a quick fix in the |
Yup! That sounds great.
On Fri, Jun 21, 2019 at 9:31 AM Stijn Van Hoey ***@***.***> wrote:
Similar error when the API is not returning any data, resulting in a KeyError:
'date.local' when usingdf=Trueinstead of returning an emptyDataFrame`
(see also current test build failure).
For example:
api.measurements(
city='Delhi',
parameter='pm25',
location='Anand Vihar',
limit=5,
df=False)
returns
(200,
{'meta': {'name': 'openaq-api',
'license': 'CC BY 4.0',
'website': 'https://docs.openaq.org/',
'page': 1,
'limit': 5,
'found': 0,
'pages': 0},
'results': []})
Whereas
api.measurements(
city='Delhi',
parameter='pm25',
location='Anand Vihar',
limit=5,
df=True)
in
...
KeyError: 'date.local'
Would it be an option if I try to provide a quick fix in the `pandasize` decorator to return an empty `DataFrame` when no results are returned? This would at least provide be more informative than the current error.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#10?email_source=notifications&email_token=ABBLASE347N55GXBJMIKSNDP3TJZZA5CNFSM4CBTZFN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYIPADA#issuecomment-504426508>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABBLASBRH3W5RMRK5EVXKMDP3TJZZANCNFSM4CBTZFNQ>
.
--
Regards,
David H Hagan
PhD Candidate - Atmospheric Physics and Chemistry
Department of Civil & Environmental Engineering
Massachusetts Institute of Technology
Cambridge, MA 02139
P. 707.227.6695 | E. [email protected] | W. https://www.davidhagan.me
<http://davidhagan.me>
|
The text was updated successfully, but these errors were encountered: