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

Calling client.list_models() throws an error #2

Open
bramrodenburg opened this issue Feb 25, 2025 · 0 comments
Open

Calling client.list_models() throws an error #2

bramrodenburg opened this issue Feb 25, 2025 · 0 comments

Comments

@bramrodenburg
Copy link

Description

When calling client.list_models(), it throws the following error:

Traceback (most recent call last):
  File "/Users/bram/Developer/Repositories/python-sdk/bye.py", line 14, in <module>
    print(client.list_models())
          ^^^^^^^^^^^^^^^^^^^^
  File "/Users/bram/Developer/Repositories/python-sdk/lightdash/client.py", line 167, in list_models
    return self.models.list() 
           ^^^^^^^^^^^^^^^^^^
  File "/Users/bram/Developer/Repositories/python-sdk/lightdash/models.py", line 159, in list
    self._ensure_loaded()
  File "/Users/bram/Developer/Repositories/python-sdk/lightdash/models.py", line 138, in _ensure_loaded
    models = self._client._fetch_models()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bram/Developer/Repositories/python-sdk/lightdash/client.py", line 154, in _fetch_models
    return [Model.from_api_response(item) for item in response_data]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bram/Developer/Repositories/python-sdk/lightdash/client.py", line 154, in <listcomp>
    return [Model.from_api_response(item) for item in response_data]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bram/Developer/Repositories/python-sdk/lightdash/models.py", line 114, in from_api_response
    type=data["type"],
         ~~~~^^^^^^^^
KeyError: 'type'

Reproduction path

  1. Initialise a new client
  2. Call client.list_models()
  3. It throws an error.
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

No branches or pull requests

1 participant