Skip to content
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

API Calls Failing Due to TypeError (0.29.0) #393

Closed
abominox opened this issue Jun 5, 2019 · 3 comments · Fixed by #397
Closed

API Calls Failing Due to TypeError (0.29.0) #393

abominox opened this issue Jun 5, 2019 · 3 comments · Fixed by #397

Comments

@abominox
Copy link

abominox commented Jun 5, 2019

Hello,

Since the release of version 0.29.0 two hours ago, I've been encountering the following error for multiple API calls:

Traceback (most recent call last):
  File "test.py", line 14, in <module>
    print (api.Monitor.get_all())
  File "/usr/local/lib/python3.7/site-packages/datadog/api/monitors.py", line 57, in get_all
    return super(Monitor, cls).get_all(**params)
  File "/usr/local/lib/python3.7/site-packages/datadog/api/resources.py", line 181, in get_all
    return APIClient.submit('GET', cls._resource_name, api_version, **params)
  File "/usr/local/lib/python3.7/site-packages/datadog/api/api_client.py", line 161, in submit
    response_obj['response_headers'] = response_headers
TypeError: list indices must be integers or slices, not str

Currently using Python version 3.7.2. So far, I have encountered this when using api.Monitor.get_all() and api.Downtime.get_all(). When I revert to 0.28.0, I no longer see these errors for these API calls.

@apgmckay
Copy link

apgmckay commented Jun 7, 2019

We have experienced the same error TypeError: list indices must be integers, not str issue when making calls to the api.Monitor.get_all() Python version 2.7.5.

@ross-bragg
Copy link

I'm also having this issue using Python 3.5. The issue appears to come from PR #378 - the response object appears to be decoded as a list and the response headers are added as though it's a dict.

@nmuesch
Copy link
Contributor

nmuesch commented Jun 10, 2019

Hey @abominox, @apgmckay and @ross-bragg I've just released version 0.29.1 of the datadogpy library that should resolve this issue. Thanks for the detailed issue report and the investigation. Let me know if you continue to experience any issues here.

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 a pull request may close this issue.

4 participants