Skip to content

Commit

Permalink
fix: Relocates `self._extract_slice_fields(stream_slice=stream_slice)…
Browse files Browse the repository at this point in the history
…` within conditional codeblock that uses it. (#304)
  • Loading branch information
pnilan authored Jan 31, 2025
1 parent 65e6a0d commit 10a7a87
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions airbyte_cdk/sources/streams/http/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,6 @@ def _read_pages(
stream_slice: Optional[Mapping[str, Any]] = None,
stream_state: Optional[Mapping[str, Any]] = None,
) -> Iterable[StreamData]:
partition, _, _ = self._extract_slice_fields(stream_slice=stream_slice)

stream_state = stream_state or {}
pagination_complete = False
next_page_token = None
Expand All @@ -438,6 +436,7 @@ def _read_pages(

cursor = self.get_cursor()
if cursor and isinstance(cursor, SubstreamResumableFullRefreshCursor):
partition, _, _ = self._extract_slice_fields(stream_slice=stream_slice)
# Substreams checkpoint state by marking an entire parent partition as completed so that on the subsequent attempt
# after a failure, completed parents are skipped and the sync can make progress
cursor.close_slice(StreamSlice(cursor_slice={}, partition=partition))
Expand Down

0 comments on commit 10a7a87

Please sign in to comment.