1111)
1212from airbyte_cdk .sources .declarative .retrievers .retriever import Retriever
1313from airbyte_cdk .sources .streams .core import StreamData
14- from airbyte_cdk .sources .types import Config , StreamSlice , StreamState
14+ from airbyte_cdk .sources .types import Config , StreamSlice
1515from airbyte_cdk .sources .utils .slice_logger import AlwaysLogSliceLogger
1616
1717
@@ -59,30 +59,6 @@ def exit_on_rate_limit(self, value: bool) -> None:
5959 if job_orchestrator is not None :
6060 job_orchestrator ._job_repository .creation_requester .exit_on_rate_limit = value # type: ignore[attr-defined, assignment]
6161
62- @property
63- def state (self ) -> StreamState :
64- """
65- As a first iteration for sendgrid, there is no state to be managed
66- """
67- return {}
68-
69- @state .setter
70- def state (self , value : StreamState ) -> None :
71- """
72- As a first iteration for sendgrid, there is no state to be managed
73- """
74- pass
75-
76- def _get_stream_state (self ) -> StreamState :
77- """
78- Gets the current state of the stream.
79-
80- Returns:
81- StreamState: Mapping[str, Any]
82- """
83-
84- return self .state
85-
8662 def _validate_and_get_stream_slice_jobs (
8763 self , stream_slice : Optional [StreamSlice ] = None
8864 ) -> Iterable [AsyncJob ]:
@@ -101,9 +77,6 @@ def _validate_and_get_stream_slice_jobs(
10177 """
10278 return stream_slice .extra_fields .get ("jobs" , []) if stream_slice else []
10379
104- def stream_slices (self ) -> Iterable [Optional [StreamSlice ]]:
105- yield from self .stream_slicer .stream_slices ()
106-
10780 def read_records (
10881 self ,
10982 records_schema : Mapping [str , Any ],
@@ -112,13 +85,12 @@ def read_records(
11285 # emit the slice_descriptor log message, for connector builder TestRead
11386 yield self .slice_logger .create_slice_log_message (stream_slice .cursor_slice ) # type: ignore
11487
115- stream_state : StreamState = self ._get_stream_state ()
11688 jobs : Iterable [AsyncJob ] = self ._validate_and_get_stream_slice_jobs (stream_slice )
11789 records : Iterable [Mapping [str , Any ]] = self .stream_slicer .fetch_records (jobs )
11890
11991 yield from self .record_selector .filter_and_transform (
12092 all_data = records ,
121- stream_state = stream_state ,
93+ stream_state = {}, # stream_state as an interpolation context is deprecated
12294 records_schema = records_schema ,
12395 stream_slice = stream_slice ,
12496 )
0 commit comments