Jan Nitschke
05/16/2023, 9:17 AMairbyte-api-python-sdk
package. I am trying to list all available sources in my workspace. I am using the example shown in the docs. My code is:
import airbyte
from airbyte.models import operations
from airbyte.models import shared
s = airbyte.Airbyte(
security=shared.Security(
bearer_auth="Bearer xxxx",
),
)
req = operations.ListSourcesRequest(
include_deleted=False,
workspace_ids=[
WORKSPACE_ID,
],
)
res = s.sources.list_sources(req)
The code is returning the following error:
Traceback (most recent call last):
File "/.../airybte_meta_source.py", line 21, in <module>
res = s.sources.list_sources(req)
File "/.../venv/lib/python3.9/site-packages/airbyte/sources.py", line 152, in list_sources
out = utils.unmarshal_json(http_res.text, Optional[shared.SourcesResponse])
File "/.../venv/lib/python3.9/site-packages/airbyte/utils/utils.py", line 681, in unmarshal_json
out = unmarhsal.from_dict({"res": json_dict})
File "/...venv/lib/python3.9/site-packages/dataclasses_json/api.py", line 72, in from_dict
return _decode_dataclass(cls, kvs, infer_missing)
File "/...venv/lib/python3.9/site-packages/dataclasses_json/core.py", line 206, in _decode_dataclass
init_kwargs[field.name] = _decode_generic(field_type,
File "/...venv/lib/python3.9/site-packages/dataclasses_json/core.py", line 282, in _decode_generic
res = _decode_dataclass(type_arg, value, infer_missing)
File "/...venv/lib/python3.9/site-packages/dataclasses_json/core.py", line 163, in _decode_dataclass
field_value = kvs[field.name]
KeyError: 'next'
It looks like the actual response does not match the expected response.
As per the API docs, the response should contain the following keys:`['data', 'next', 'previous']` . However, the API is only returning the data
key.
Can someone reproduce this error or am I missing something on my request?Jon Tan (Airbyte)
05/16/2023, 2:22 PMJan Nitschke
05/16/2023, 3:10 PMJon Tan (Airbyte)
05/16/2023, 6:17 PMJan Nitschke
05/17/2023, 5:57 AM