Skip to content

Commit 37698f5

Browse files
author
maxime.c
committed
fix warnings
1 parent 3fb450c commit 37698f5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

airbyte_cdk/sources/declarative/retrievers/pagination_tracker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ def has_reached_limit(self) -> bool:
4343

4444
def reset(self) -> None:
4545
self._record_count = 0
46+
self._number_of_attempt_with_same_slice = 0
4647

4748
def reduce_slice_range_if_possible(self, stream_slice: StreamSlice) -> StreamSlice:
4849
new_slice = self._cursor.reduce_slice_range(stream_slice) if self._cursor else stream_slice
4950

50-
self._number_of_attempt_with_same_slice += 1
5151
if new_slice == stream_slice:
52+
self._number_of_attempt_with_same_slice += 1
5253
if (
5354
self._number_of_attempt_with_same_slice
5455
>= self._allowed_number_of_attempt_with_same_slice
@@ -57,5 +58,7 @@ def reduce_slice_range_if_possible(self, stream_slice: StreamSlice) -> StreamSli
5758
internal_message=f"There were {self._number_of_attempt_with_same_slice} attempts with the same slice already while the max allowed is {self._allowed_number_of_attempt_with_same_slice}",
5859
failure_type=FailureType.system_error,
5960
)
61+
else:
62+
self._number_of_attempt_with_same_slice = 0
6063

6164
return new_slice

0 commit comments

Comments
 (0)