airbyte-cdk 6.46.0__py3-none-any.whl → 6.46.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) 2024 Airbyte, Inc., all rights reserved.
2
2
 
3
- from typing import Any, Iterable, Mapping, Optional
3
+ from typing import Any, Hashable, Iterable, Mapping, Optional
4
4
 
5
5
  from airbyte_cdk.sources.declarative.retrievers import Retriever
6
6
  from airbyte_cdk.sources.message import MessageRepository
@@ -89,5 +89,21 @@ class StreamSlicerPartitionGenerator(PartitionGenerator):
89
89
  self._stream_slicer = stream_slicer
90
90
 
91
91
  def generate(self) -> Iterable[Partition]:
92
+ # Yield partitions for unique stream slices, avoiding duplicates
93
+ seen_slices: set[Hashable] = set()
92
94
  for stream_slice in self._stream_slicer.stream_slices():
95
+ slice_key = self._make_hashable(stream_slice)
96
+ if slice_key in seen_slices:
97
+ continue
98
+ seen_slices.add(slice_key)
93
99
  yield self._partition_factory.create(stream_slice)
100
+
101
+ @staticmethod
102
+ def _make_hashable(obj: Any) -> Any:
103
+ if isinstance(obj, dict):
104
+ return frozenset(
105
+ (k, StreamSlicerPartitionGenerator._make_hashable(v)) for k, v in obj.items()
106
+ )
107
+ if isinstance(obj, list):
108
+ return tuple(StreamSlicerPartitionGenerator._make_hashable(i) for i in obj)
109
+ return obj
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.46.0
3
+ Version: 6.46.1
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -199,7 +199,7 @@ airbyte_cdk/sources/declarative/schema/schema_loader.py,sha256=kjt8v0N5wWKA5zyLn
199
199
  airbyte_cdk/sources/declarative/spec/__init__.py,sha256=H0UwoRhgucbKBIzg85AXrifybVmfpwWpPdy22vZKVuo,141
200
200
  airbyte_cdk/sources/declarative/spec/spec.py,sha256=ODSNUgkDOhnLQnwLjgSaME6R3kNeywjROvbNrWEnsgU,1876
201
201
  airbyte_cdk/sources/declarative/stream_slicers/__init__.py,sha256=sI9vhc95RwJYOnA0VKjcbtKgFcmAbWjhdWBXFbAijOs,176
202
- airbyte_cdk/sources/declarative/stream_slicers/declarative_partition_generator.py,sha256=cjKGm4r438dd1GxrFHJ4aYrdzG2bkncnwaWxAwlXR3M,3585
202
+ airbyte_cdk/sources/declarative/stream_slicers/declarative_partition_generator.py,sha256=V_WXPrEzn3mlS_calo5GHUIkugGKcrDwHp06uaQLUMg,4247
203
203
  airbyte_cdk/sources/declarative/stream_slicers/stream_slicer.py,sha256=SOkIPBi2Wu7yxIvA15yFzUAB95a3IzA8LPq5DEqHQQc,725
204
204
  airbyte_cdk/sources/declarative/transformations/__init__.py,sha256=CPJ8TlMpiUmvG3624VYu_NfTzxwKcfBjM2Q2wJ7fkSA,919
205
205
  airbyte_cdk/sources/declarative/transformations/add_fields.py,sha256=Eg1jQtRObgzxbtySTQs5uEZIjEklsoHFxYSPf78x6Ng,5420
@@ -390,9 +390,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
390
390
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
391
391
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
392
392
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
393
- airbyte_cdk-6.46.0.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
394
- airbyte_cdk-6.46.0.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
395
- airbyte_cdk-6.46.0.dist-info/METADATA,sha256=eSI3s45Ad2eapQZ2X1Z28DGP5Sp_VnASv7ZrR0fyKJs,6323
396
- airbyte_cdk-6.46.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
397
- airbyte_cdk-6.46.0.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
398
- airbyte_cdk-6.46.0.dist-info/RECORD,,
393
+ airbyte_cdk-6.46.1.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
394
+ airbyte_cdk-6.46.1.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
395
+ airbyte_cdk-6.46.1.dist-info/METADATA,sha256=7LlsiUvkE6tU3sQz44kb011La3QmPw8wYWSfcuSeqSc,6323
396
+ airbyte_cdk-6.46.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
397
+ airbyte_cdk-6.46.1.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
398
+ airbyte_cdk-6.46.1.dist-info/RECORD,,