dlt-hub / verified-sources

Contribute to dlt verified sources 🔥
https://dlthub.com/docs/walkthroughs/add-a-verified-source
Apache License 2.0
52 stars 40 forks source link

[REST source] header_links can extract from responses without a records_path #382

Closed willi-mueller closed 4 months ago

willi-mueller commented 4 months ago

Tell us what you do here

Relevant issue

issue #313

More PR info

Before: responses without the necessity for a records_path such as [{"id": 0, "attr": "foobar"}] caused the following exception with the header_links paginator :

  File "rest_api/client.py", line 148, in paginate
    yield extract_records(response)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable

Before

Screenshot 2024-02-29 at 22 59 32

After

Screenshot 2024-02-29 at 22 59 58
burnash commented 4 months ago

Brilliant! Thanks @willi-mueller!