airbyte-cdk 6.46.1__py3-none-any.whl → 6.47.0.dev0__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.
- airbyte_cdk/sources/declarative/incremental/concurrent_partition_cursor.py +8 -1
- airbyte_cdk/sources/declarative/stream_slicers/declarative_partition_generator.py +1 -17
- {airbyte_cdk-6.46.1.dist-info → airbyte_cdk-6.47.0.dev0.dist-info}/METADATA +1 -1
- {airbyte_cdk-6.46.1.dist-info → airbyte_cdk-6.47.0.dev0.dist-info}/RECORD +8 -8
- {airbyte_cdk-6.46.1.dist-info → airbyte_cdk-6.47.0.dev0.dist-info}/LICENSE.txt +0 -0
- {airbyte_cdk-6.46.1.dist-info → airbyte_cdk-6.47.0.dev0.dist-info}/LICENSE_SHORT +0 -0
- {airbyte_cdk-6.46.1.dist-info → airbyte_cdk-6.47.0.dev0.dist-info}/WHEEL +0 -0
- {airbyte_cdk-6.46.1.dist-info → airbyte_cdk-6.47.0.dev0.dist-info}/entry_points.txt +0 -0
@@ -65,6 +65,7 @@ class ConcurrentPerPartitionCursor(Cursor):
|
|
65
65
|
_NO_CURSOR_STATE: Mapping[str, Any] = {}
|
66
66
|
_GLOBAL_STATE_KEY = "state"
|
67
67
|
_PERPARTITION_STATE_KEY = "states"
|
68
|
+
_IS_PARTITION_DUPLICATION_LOGGED = False
|
68
69
|
_KEY = 0
|
69
70
|
_VALUE = 1
|
70
71
|
|
@@ -279,7 +280,13 @@ class ConcurrentPerPartitionCursor(Cursor):
|
|
279
280
|
with self._lock:
|
280
281
|
self._number_of_partitions += 1
|
281
282
|
self._cursor_per_partition[partition_key] = cursor
|
282
|
-
|
283
|
+
|
284
|
+
if partition_key in self._semaphore_per_partition:
|
285
|
+
if not self._IS_PARTITION_DUPLICATION_LOGGED:
|
286
|
+
logger.warning(f"Partition duplication detected for stream {self._stream_name}")
|
287
|
+
self._IS_PARTITION_DUPLICATION_LOGGED = True
|
288
|
+
else:
|
289
|
+
self._semaphore_per_partition[partition_key] = threading.Semaphore(0)
|
283
290
|
|
284
291
|
with self._lock:
|
285
292
|
if (
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
|
2
2
|
|
3
|
-
from typing import Any,
|
3
|
+
from typing import Any, 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,21 +89,5 @@ 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()
|
94
92
|
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)
|
99
93
|
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
|
@@ -100,7 +100,7 @@ airbyte_cdk/sources/declarative/extractors/record_selector.py,sha256=Xg4e0exJ5Tq
|
|
100
100
|
airbyte_cdk/sources/declarative/extractors/response_to_file_extractor.py,sha256=WJyA2OYIEgFpVP5Y3o0tIj69AV6IKkn9B16MeXaEItI,6513
|
101
101
|
airbyte_cdk/sources/declarative/extractors/type_transformer.py,sha256=d6Y2Rfg8pMVEEnHllfVksWZdNVOU55yk34O03dP9muY,1626
|
102
102
|
airbyte_cdk/sources/declarative/incremental/__init__.py,sha256=U1oZKtBaEC6IACmvziY9Wzg7Z8EgF4ZuR7NwvjlB_Sk,1255
|
103
|
-
airbyte_cdk/sources/declarative/incremental/concurrent_partition_cursor.py,sha256=
|
103
|
+
airbyte_cdk/sources/declarative/incremental/concurrent_partition_cursor.py,sha256=4OSvZWRhKNORXJUchlvXKsWMbZKSC20AKDzt1hQnDz8,22602
|
104
104
|
airbyte_cdk/sources/declarative/incremental/datetime_based_cursor.py,sha256=Rbe6lJLTtZ5en33MwZiB9-H9-AwDMNHgwBZs8EqhYqk,22172
|
105
105
|
airbyte_cdk/sources/declarative/incremental/declarative_cursor.py,sha256=5Bhw9VRPyIuCaD0wmmq_L3DZsa-rJgtKSEUzSd8YYD0,536
|
106
106
|
airbyte_cdk/sources/declarative/incremental/global_substream_cursor.py,sha256=2tsE6FgXzemf4fZZ4uGtd8QpRBl9GJ2CRqSNJE5p0EI,16077
|
@@ -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=
|
202
|
+
airbyte_cdk/sources/declarative/stream_slicers/declarative_partition_generator.py,sha256=cjKGm4r438dd1GxrFHJ4aYrdzG2bkncnwaWxAwlXR3M,3585
|
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.
|
394
|
-
airbyte_cdk-6.
|
395
|
-
airbyte_cdk-6.
|
396
|
-
airbyte_cdk-6.
|
397
|
-
airbyte_cdk-6.
|
398
|
-
airbyte_cdk-6.
|
393
|
+
airbyte_cdk-6.47.0.dev0.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
|
394
|
+
airbyte_cdk-6.47.0.dev0.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
|
395
|
+
airbyte_cdk-6.47.0.dev0.dist-info/METADATA,sha256=w15gBn52dA5wRUmZ_w1t2ViE2CDJimBiS4PWfjnK2vg,6328
|
396
|
+
airbyte_cdk-6.47.0.dev0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
397
|
+
airbyte_cdk-6.47.0.dev0.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
|
398
|
+
airbyte_cdk-6.47.0.dev0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|