Stéphane Burwash
04/21/2023, 7:23 PMTypeError: MyPaginator.get_next_url() missing 1 required positional argument: 'previous_token'
Is this normal? I have not overwritten get_next_url (don't even have it in my client.py
)
What's the best method to debug this? Is there a quick fix?
Thanks đedgar_ramirez_mondragon
04/21/2023, 8:12 PMget_new_paginator
. It should be
class MyStream(RESTStream):
def get_new_paginator(self):
return MyPaginator()
Stéphane Burwash
04/21/2023, 8:13 PMStéphane Burwash
04/21/2023, 8:17 PMget_next_url
depend upon?edgar_ramirez_mondragon
04/21/2023, 8:23 PMdata
in the example shared above is a dictionary of the API response so it certainly supports arbitrary nested json values, e.g. data.get("some_object", {}).get("a_nested_value")
You might wanna checks the unit tests for a custom hateoas pagination to see if thereâs any problems in your implementation: https://github.com/meltano/sdk/blob/ad0c2d34b1f94063ab006464eb9bb393d44ddd9c/tests/core/rest/test_pagination.py#L294-L309StĂ©phane Burwash
04/21/2023, 8:32 PMStéphane Burwash
04/21/2023, 8:36 PMedgar_ramirez_mondragon
04/21/2023, 8:55 PMin your test you do not mention a previous token - is this normal?Yeah itâs normally not required, but if you need to access the previous pagination value, thereâs a
current_value
read-only property.
Iâm just flooding you with questions, I apologizeOh, no worries! Happy to help and hopefully uncover a gap in the docs or an actual đ
is there a setting in the sdk to replace the existing url with a new one? The API I am working with returns the full url to the next page, not just a path to take on to the base urlNot really, but thereâs an example of how to parse the ânext URLâ to get the query params here: https://sdk.meltano.com/en/latest/classes/singer_sdk.pagination.BaseHATEOASPaginator.html#singer_sdk.pagination.BaseHATEOASPaginator
Stéphane Burwash
04/21/2023, 9:03 PM