Skip to content

Commit

Permalink
CDK: ref
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Inzhyyants <artem.inzhyyants@gmail.com>
  • Loading branch information
artem1205 committed Jan 28, 2025
1 parent 9cb3a73 commit 185fe42
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions airbyte_cdk/sources/declarative/retrievers/async_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ def _validate_and_get_stream_slice_partition(
AirbyteTracedException: If the stream_slice is not an instance of StreamSlice or if the partition is not present in the stream_slice.
"""
if not isinstance(stream_slice, StreamSlice) or "partition" not in stream_slice.partition:
raise AirbyteTracedException(
message="Invalid arguments to AsyncRetriever.read_records: stream_slice is not optional. Please contact Airbyte Support",
failure_type=FailureType.system_error,
)
return stream_slice["partition"] # type: ignore # stream_slice["partition"] has been added as an AsyncPartition as part of stream_slices
return stream_slice
# if not isinstance(stream_slice, StreamSlice) or "partition" not in stream_slice.partition:
# raise AirbyteTracedException(
# message="Invalid arguments to AsyncRetriever.read_records: stream_slice is not optional. Please contact Airbyte Support",
# failure_type=FailureType.system_error,
# )
# return stream_slice["partition"] # type: ignore # stream_slice["partition"] has been added as an AsyncPartition as part of stream_slices

def stream_slices(self) -> Iterable[Optional[StreamSlice]]:
return self.stream_slicer.stream_slices()
Expand Down

0 comments on commit 185fe42

Please sign in to comment.