Skip to content

Commit

Permalink
updates signature of Paginator.update_state()
Browse files Browse the repository at this point in the history
  • Loading branch information
willi-mueller committed Aug 22, 2024
1 parent f36a146 commit 4de267f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/sources/rest_api/integration/test_offline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from typing import Any, List, Optional
from unittest import mock

import pytest
from requests import Request, Response

import dlt
from dlt.common import pendulum
Expand Down Expand Up @@ -140,10 +142,10 @@ def test_ignoring_endpoint_returning_404(mock_api_server):

def test_source_with_post_request(mock_api_server):
class JSONBodyPageCursorPaginator(BaseReferencePaginator):
def update_state(self, response):
def update_state(self, response: Response, data: Optional[List[Any]] = None) -> None:
self._next_reference = response.json().get("next_page")

def update_request(self, request):
def update_request(self, request: Request) -> None:
if request.json is None:
request.json = {}

Expand Down

0 comments on commit 4de267f

Please sign in to comment.