GearPlug / microsoftgraph-python

Microsoft Graph API wrapper written in Python
MIT License
96 stars 40 forks source link

KeyError in Client #32

Closed ggravlingen closed 2 years ago

ggravlingen commented 2 years ago

Hi,

I'm getting this error after updating to 1.1.1. Not sure if this is a local issue or a bug? Noted some changes where made in nearby code in this PR: https://github.com/GearPlug/microsoftgraph-python/pull/29

Error in Microsoft login hook error Traceback (most recent call last):
  File "/workspaces/.../.../integrations/azure/aad/auth_hook.py", line 43, in handle_login
    user = client.users.get_me()
  File "/usr/src/.venv/lib/python3.8/site-packages/microsoftgraph/decorators.py", line 11, in helper
    return func(*args, **kwargs)
  File "/usr/src/.venv/lib/python3.8/site-packages/microsoftgraph/users.py", line 32, in get_me
    return self._client._get(self._client.base_url + "me", params=params)
  File "/usr/src/.venv/lib/python3.8/site-packages/microsoftgraph/client.py", line 227, in _get
    return self._paginate_response(response)
  File "/usr/src/.venv/lib/python3.8/site-packages/microsoftgraph/client.py", line 215, in _paginate_response
    data = list(response.data["value"])
KeyError: 'value'
Free-devloper commented 2 years ago

Me too Anyone resolved it yet?

ingmferrer commented 2 years ago

Release 1.1.2 should resolve this, please upgrade and let me know if everything works as expected.

ggravlingen commented 2 years ago

Unfortunately not, I'm getting the same error. The error is on line 215: https://github.com/GearPlug/microsoftgraph-python/blob/0e3a6ccd51948a809be04edc47c87328881e9446/microsoftgraph/client.py#L215

ingmferrer commented 2 years ago

I forgot to mention that shortly after I commented this issue, I released the 1.1.3 version, so please upgrade to that version because it includes new validations.

ggravlingen commented 2 years ago

There are no errors now. Thank you!