Skip to content

Commit 3fb450c

Browse files
author
maxime.c
committed
mypy
1 parent f90b110 commit 3fb450c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3355,8 +3355,11 @@ def _get_url(req: Requester) -> str:
33553355
)
33563356

33573357
def _create_pagination_tracker_factory(
3358-
self, model: PaginationResetModel, cursor: Cursor
3358+
self, model: Optional[PaginationResetModel], cursor: Cursor
33593359
) -> Callable[[], PaginationTracker]:
3360+
if model is None:
3361+
return lambda: PaginationTracker()
3362+
33603363
# Until we figure out a way to use any cursor for PaginationTracker, we will have to have this cursor selector logic
33613364
cursor_for_pagination_tracking = None
33623365
if isinstance(cursor, ConcurrentCursor):

airbyte_cdk/sources/declarative/retrievers/simple_retriever.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ def _read_pages(
450450
next_page_token.get("next_page_token") if next_page_token else None
451451
)
452452
next_page_token = self._next_page_token(
453-
response=response,
453+
response=response, # type:ignore # we are breaking from the loop on the try/else if there are no response so this should be fine
454454
last_page_size=last_page_size,
455455
last_record=last_record,
456456
last_page_token_value=last_page_token_value,
@@ -461,7 +461,7 @@ def _read_pages(
461461
# Always return an empty generator just in case no records were ever yielded
462462
yield from []
463463

464-
def _get_initial_next_page_token(self):
464+
def _get_initial_next_page_token(self) -> Optional[Mapping[str, Any]]:
465465
initial_token = self._paginator.get_initial_token()
466466
next_page_token = {"next_page_token": initial_token} if initial_token is not None else None
467467
return next_page_token

0 commit comments

Comments
 (0)