airbyte-cdk 0.53.3__py3-none-any.whl → 0.53.4__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.
@@ -154,7 +154,7 @@ class ThreadBasedConcurrentStream(AbstractStream):
154
154
  if len(futures) < self._max_concurrent_tasks:
155
155
  return
156
156
 
157
- for index in range(len(futures)):
157
+ for index in reversed(range(len(futures))):
158
158
  future = futures[index]
159
159
  optional_exception = future.exception()
160
160
  if optional_exception:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 0.53.3
3
+ Version: 0.53.4
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://github.com/airbytehq/airbyte
6
6
  Author: Airbyte
@@ -199,7 +199,7 @@ airbyte_cdk/sources/streams/concurrent/exceptions.py,sha256=-WETGIY5_QFmVeDFiqm4
199
199
  airbyte_cdk/sources/streams/concurrent/partition_enqueuer.py,sha256=uAUhCkxFOaptDJfIEDmFnnF4xn4coG5kvE4B_5tVx14,1557
200
200
  airbyte_cdk/sources/streams/concurrent/partition_reader.py,sha256=H8sGVVGx6uKMSUehRaqmVbE19DE3cx3NivQ4sFj8wbk,1303
201
201
  airbyte_cdk/sources/streams/concurrent/state_converter.py,sha256=PwqcRVPR6LQxWL0yvPTp_u2Uh0hBJU-BDSjPKiyJVEk,4689
202
- airbyte_cdk/sources/streams/concurrent/thread_based_concurrent_stream.py,sha256=ZfjrqY-I43H-qQHmwJnHnP_4snvPBFwD9dIVwV1gOqU,10833
202
+ airbyte_cdk/sources/streams/concurrent/thread_based_concurrent_stream.py,sha256=M7CpPPBswHTYjG4opiTOf5eWHOJ6i4TyP0v991pFxOo,10843
203
203
  airbyte_cdk/sources/streams/concurrent/partitions/__init__.py,sha256=4Hw-PX1-VgESLF16cDdvuYCzGJtHntThLF4qIiULWeo,61
204
204
  airbyte_cdk/sources/streams/concurrent/partitions/partition.py,sha256=tjXF8lZMvyfZaCYCHr5aTPwbVstmRjYZDwYAvLDY-ds,1312
205
205
  airbyte_cdk/sources/streams/concurrent/partitions/partition_generator.py,sha256=_ymkkBr71_qt1fW0_MUqw96OfNBkeJngXQ09yolEDHw,441
@@ -387,7 +387,7 @@ unit_tests/sources/streams/concurrent/test_concurrent_partition_generator.py,sha
387
387
  unit_tests/sources/streams/concurrent/test_cursor.py,sha256=sqH8xE3GamETSSVqsdKafziAAm-y_j_MegES_C5ExMM,5790
388
388
  unit_tests/sources/streams/concurrent/test_partition_reader.py,sha256=eM5dzfmLKm9Lj-BfQUjAZRhCZzfvhk7AkKpcHGcoPfg,931
389
389
  unit_tests/sources/streams/concurrent/test_state_converter.py,sha256=rvg8becWR1iPdm5TAanZssKj5_iw8dInE_uqmjqghZE,8349
390
- unit_tests/sources/streams/concurrent/test_thread_based_concurrent_stream.py,sha256=HJYZCwgSyGmKdQSInZK1rUDbtW5RepdOa05hC10RPe4,10894
390
+ unit_tests/sources/streams/concurrent/test_thread_based_concurrent_stream.py,sha256=_jBMJIZ6Hu9mWX4v9SRUdtxvgntA-rQpNbbygBi6HXA,11629
391
391
  unit_tests/sources/streams/concurrent/scenarios/__init__.py,sha256=4Hw-PX1-VgESLF16cDdvuYCzGJtHntThLF4qIiULWeo,61
392
392
  unit_tests/sources/streams/concurrent/scenarios/incremental_scenarios.py,sha256=x77AQf8_O4dQ2aF1o800CzI0hOEyU8ayxoNdSOvxkhM,10495
393
393
  unit_tests/sources/streams/concurrent/scenarios/stream_facade_builder.py,sha256=FdgEO-bWA_IDFIJb0W83qE4QCCZ8eexbn_Mq8LJq0iE,5040
@@ -411,8 +411,8 @@ unit_tests/utils/test_schema_inferrer.py,sha256=Z2jHBZ540wnYkylIdV_2xr75Vtwlxuyg
411
411
  unit_tests/utils/test_secret_utils.py,sha256=XKe0f1RHYii8iwE6ATmBr5JGDI1pzzrnZUGdUSMJQP4,4886
412
412
  unit_tests/utils/test_stream_status_utils.py,sha256=N2TxwKge45RHUKFlPcP2o5jXYjJPKMKiu6Fm2_leZYY,3388
413
413
  unit_tests/utils/test_traced_exception.py,sha256=bDFP5zMBizFenz6V2WvEZTRCKGB5ijh3DBezjbfoYIs,4198
414
- airbyte_cdk-0.53.3.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
415
- airbyte_cdk-0.53.3.dist-info/METADATA,sha256=9cv_fGW7SUbezVGIwe5oJYruTMWoPRAaD6rWassO2IU,11983
416
- airbyte_cdk-0.53.3.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
417
- airbyte_cdk-0.53.3.dist-info/top_level.txt,sha256=edvsDKTnE6sD2wfCUaeTfKf5gQIL6CPVMwVL2sWZzqo,51
418
- airbyte_cdk-0.53.3.dist-info/RECORD,,
414
+ airbyte_cdk-0.53.4.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
415
+ airbyte_cdk-0.53.4.dist-info/METADATA,sha256=n_0ZAbpdj_k3YO8y-B1g9javdvN876EaSuA6-Cu5xQY,11983
416
+ airbyte_cdk-0.53.4.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
417
+ airbyte_cdk-0.53.4.dist-info/top_level.txt,sha256=edvsDKTnE6sD2wfCUaeTfKf5gQIL6CPVMwVL2sWZzqo,51
418
+ airbyte_cdk-0.53.4.dist-info/RECORD,,
@@ -13,6 +13,8 @@ from airbyte_cdk.sources.streams.concurrent.partitions.partition import Partitio
13
13
  from airbyte_cdk.sources.streams.concurrent.partitions.record import Record
14
14
  from airbyte_cdk.sources.streams.concurrent.thread_based_concurrent_stream import ThreadBasedConcurrentStream
15
15
 
16
+ _MAX_CONCURRENT_TASKS = 2
17
+
16
18
 
17
19
  class ThreadBasedConcurrentStreamTest(unittest.TestCase):
18
20
  def setUp(self):
@@ -39,7 +41,7 @@ class ThreadBasedConcurrentStreamTest(unittest.TestCase):
39
41
  self._logger,
40
42
  self._message_repository,
41
43
  1,
42
- 2,
44
+ _MAX_CONCURRENT_TASKS,
43
45
  0,
44
46
  cursor=self._cursor,
45
47
  )
@@ -142,15 +144,33 @@ class ThreadBasedConcurrentStreamTest(unittest.TestCase):
142
144
  f2 = Mock()
143
145
 
144
146
  # Verify that the done() method will be called until only one future is still running
145
- f1.done.return_value = False
147
+ f1.done.return_value = True
146
148
  f1.exception.return_value = None
147
- f2.done.return_value = False
148
- f2.exception.return_value = ValueError("An exception")
149
+ f2.done.return_value = True
150
+ f2.exception.return_value = ValueError("ERROR")
149
151
  futures = [f1, f2]
150
152
 
151
153
  with pytest.raises(RuntimeError):
152
154
  self._stream._wait_while_too_many_pending_futures(futures)
153
155
 
156
+ def test_given_removing_multiple_elements_when_pruning_then_fail_immediately(self):
157
+ # Verify that the done() method will be called until only one future is still running
158
+ futures = []
159
+ for _ in range(_MAX_CONCURRENT_TASKS + 1):
160
+ future = Mock()
161
+ future.done.return_value = True
162
+ future.exception.return_value = None
163
+ futures.append(future)
164
+
165
+ pending_future = Mock()
166
+ pending_future.done.return_value = False
167
+ pending_future.exception.return_value = None
168
+ futures.append(pending_future)
169
+
170
+ self._stream._wait_while_too_many_pending_futures(futures)
171
+
172
+ assert futures == [pending_future]
173
+
154
174
  def test_as_airbyte_stream(self):
155
175
  expected_airbyte_stream = AirbyteStream(
156
176
  name=self._name,