From 10a7a873b9212b7e1af230ed13ce833c3741a3c4 Mon Sep 17 00:00:00 2001 From: Patrick Nilan Date: Fri, 31 Jan 2025 09:23:01 -0800 Subject: [PATCH] fix: Relocates `self._extract_slice_fields(stream_slice=stream_slice)` within conditional codeblock that uses it. (#304) --- airbyte_cdk/sources/streams/http/http.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/airbyte_cdk/sources/streams/http/http.py b/airbyte_cdk/sources/streams/http/http.py index 40eab27a3..fbf4fe35d 100644 --- a/airbyte_cdk/sources/streams/http/http.py +++ b/airbyte_cdk/sources/streams/http/http.py @@ -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 @@ -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))