airbyte-cdk 7.3.10.dev0__py3-none-any.whl → 7.3.10.dev1__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.
Potentially problematic release.
This version of airbyte-cdk might be problematic. Click here for more details.
- airbyte_cdk/sources/concurrent_source/concurrent_read_processor.py +12 -22
 - airbyte_cdk/sources/streams/concurrent/cursor.py +9 -9
 - airbyte_cdk/sources/streams/concurrent/partition_reader.py +3 -1
 - {airbyte_cdk-7.3.10.dev0.dist-info → airbyte_cdk-7.3.10.dev1.dist-info}/METADATA +1 -1
 - {airbyte_cdk-7.3.10.dev0.dist-info → airbyte_cdk-7.3.10.dev1.dist-info}/RECORD +9 -9
 - {airbyte_cdk-7.3.10.dev0.dist-info → airbyte_cdk-7.3.10.dev1.dist-info}/LICENSE.txt +0 -0
 - {airbyte_cdk-7.3.10.dev0.dist-info → airbyte_cdk-7.3.10.dev1.dist-info}/LICENSE_SHORT +0 -0
 - {airbyte_cdk-7.3.10.dev0.dist-info → airbyte_cdk-7.3.10.dev1.dist-info}/WHEEL +0 -0
 - {airbyte_cdk-7.3.10.dev0.dist-info → airbyte_cdk-7.3.10.dev1.dist-info}/entry_points.txt +0 -0
 
| 
         @@ -96,12 +96,13 @@ class ConcurrentReadProcessor: 
     | 
|
| 
       96 
96 
     | 
    
         
             
                    """
         
     | 
| 
       97 
97 
     | 
    
         
             
                    stream_name = partition.stream_name()
         
     | 
| 
       98 
98 
     | 
    
         
             
                    self._streams_to_running_partitions[stream_name].add(partition)
         
     | 
| 
      
 99 
     | 
    
         
            +
                    cursor = self._stream_name_to_instance[stream_name].cursor
         
     | 
| 
       99 
100 
     | 
    
         
             
                    if self._slice_logger.should_log_slice_message(self._logger):
         
     | 
| 
       100 
101 
     | 
    
         
             
                        self._message_repository.emit_message(
         
     | 
| 
       101 
102 
     | 
    
         
             
                            self._slice_logger.create_slice_log_message(partition.to_slice())
         
     | 
| 
       102 
103 
     | 
    
         
             
                        )
         
     | 
| 
       103 
104 
     | 
    
         
             
                    self._thread_pool_manager.submit(
         
     | 
| 
       104 
     | 
    
         
            -
                        self._partition_reader.process_partition, partition
         
     | 
| 
      
 105 
     | 
    
         
            +
                        self._partition_reader.process_partition, partition, cursor
         
     | 
| 
       105 
106 
     | 
    
         
             
                    )
         
     | 
| 
       106 
107 
     | 
    
         | 
| 
       107 
108 
     | 
    
         
             
                def on_partition_complete_sentinel(
         
     | 
| 
         @@ -115,26 +116,16 @@ class ConcurrentReadProcessor: 
     | 
|
| 
       115 
116 
     | 
    
         
             
                    """
         
     | 
| 
       116 
117 
     | 
    
         
             
                    partition = sentinel.partition
         
     | 
| 
       117 
118 
     | 
    
         | 
| 
       118 
     | 
    
         
            -
                     
     | 
| 
       119 
     | 
    
         
            -
             
     | 
| 
       120 
     | 
    
         
            -
             
     | 
| 
       121 
     | 
    
         
            -
             
     | 
| 
       122 
     | 
    
         
            -
             
     | 
| 
       123 
     | 
    
         
            -
             
     | 
| 
       124 
     | 
    
         
            -
             
     | 
| 
       125 
     | 
    
         
            -
             
     | 
| 
       126 
     | 
    
         
            -
             
     | 
| 
       127 
     | 
    
         
            -
                     
     | 
| 
       128 
     | 
    
         
            -
                        partitions_running = self._streams_to_running_partitions[partition.stream_name()]
         
     | 
| 
       129 
     | 
    
         
            -
                        if partition in partitions_running:
         
     | 
| 
       130 
     | 
    
         
            -
                            partitions_running.remove(partition)
         
     | 
| 
       131 
     | 
    
         
            -
                            # If all partitions were generated and this was the last one, the stream is done
         
     | 
| 
       132 
     | 
    
         
            -
                            if (
         
     | 
| 
       133 
     | 
    
         
            -
                                partition.stream_name() not in self._streams_currently_generating_partitions
         
     | 
| 
       134 
     | 
    
         
            -
                                and len(partitions_running) == 0
         
     | 
| 
       135 
     | 
    
         
            -
                            ):
         
     | 
| 
       136 
     | 
    
         
            -
                                yield from self._on_stream_is_done(partition.stream_name())
         
     | 
| 
       137 
     | 
    
         
            -
                        yield from self._message_repository.consume_queue()
         
     | 
| 
      
 119 
     | 
    
         
            +
                    partitions_running = self._streams_to_running_partitions[partition.stream_name()]
         
     | 
| 
      
 120 
     | 
    
         
            +
                    if partition in partitions_running:
         
     | 
| 
      
 121 
     | 
    
         
            +
                        partitions_running.remove(partition)
         
     | 
| 
      
 122 
     | 
    
         
            +
                        # If all partitions were generated and this was the last one, the stream is done
         
     | 
| 
      
 123 
     | 
    
         
            +
                        if (
         
     | 
| 
      
 124 
     | 
    
         
            +
                            partition.stream_name() not in self._streams_currently_generating_partitions
         
     | 
| 
      
 125 
     | 
    
         
            +
                            and len(partitions_running) == 0
         
     | 
| 
      
 126 
     | 
    
         
            +
                        ):
         
     | 
| 
      
 127 
     | 
    
         
            +
                            yield from self._on_stream_is_done(partition.stream_name())
         
     | 
| 
      
 128 
     | 
    
         
            +
                    yield from self._message_repository.consume_queue()
         
     | 
| 
       138 
129 
     | 
    
         | 
| 
       139 
130 
     | 
    
         
             
                def on_record(self, record: Record) -> Iterable[AirbyteMessage]:
         
     | 
| 
       140 
131 
     | 
    
         
             
                    """
         
     | 
| 
         @@ -163,7 +154,6 @@ class ConcurrentReadProcessor: 
     | 
|
| 
       163 
154 
     | 
    
         
             
                                stream.as_airbyte_stream(), AirbyteStreamStatus.RUNNING
         
     | 
| 
       164 
155 
     | 
    
         
             
                            )
         
     | 
| 
       165 
156 
     | 
    
         
             
                        self._record_counter[stream.name] += 1
         
     | 
| 
       166 
     | 
    
         
            -
                        stream.cursor.observe(record)
         
     | 
| 
       167 
157 
     | 
    
         
             
                    yield message
         
     | 
| 
       168 
158 
     | 
    
         
             
                    yield from self._message_repository.consume_queue()
         
     | 
| 
       169 
159 
     | 
    
         | 
| 
         @@ -198,7 +198,7 @@ class ConcurrentCursor(Cursor): 
     | 
|
| 
       198 
198 
     | 
    
         
             
                    # not thread safe. When multiple partitions are being closed by the cursor at the same time, it is
         
     | 
| 
       199 
199 
     | 
    
         
             
                    # possible for one partition to update concurrent_state after a second partition has already read
         
     | 
| 
       200 
200 
     | 
    
         
             
                    # the previous state. This can lead to the second partition overwriting the previous one's state.
         
     | 
| 
       201 
     | 
    
         
            -
                     
     | 
| 
      
 201 
     | 
    
         
            +
                    self._lock = threading.Lock()
         
     | 
| 
       202 
202 
     | 
    
         | 
| 
       203 
203 
     | 
    
         
             
                @property
         
     | 
| 
       204 
204 
     | 
    
         
             
                def state(self) -> MutableMapping[str, Any]:
         
     | 
| 
         @@ -273,14 +273,14 @@ class ConcurrentCursor(Cursor): 
     | 
|
| 
       273 
273 
     | 
    
         
             
                    return self._connector_state_converter.parse_value(self._cursor_field.extract_value(record))
         
     | 
| 
       274 
274 
     | 
    
         | 
| 
       275 
275 
     | 
    
         
             
                def close_partition(self, partition: Partition) -> None:
         
     | 
| 
       276 
     | 
    
         
            -
                     
     | 
| 
       277 
     | 
    
         
            -
             
     | 
| 
       278 
     | 
    
         
            -
             
     | 
| 
       279 
     | 
    
         
            -
             
     | 
| 
       280 
     | 
    
         
            -
             
     | 
| 
       281 
     | 
    
         
            -
             
     | 
| 
       282 
     | 
    
         
            -
             
     | 
| 
       283 
     | 
    
         
            -
             
     | 
| 
      
 276 
     | 
    
         
            +
                    with self._lock:
         
     | 
| 
      
 277 
     | 
    
         
            +
                        slice_count_before = len(self._concurrent_state.get("slices", []))
         
     | 
| 
      
 278 
     | 
    
         
            +
                        self._add_slice_to_state(partition)
         
     | 
| 
      
 279 
     | 
    
         
            +
                        if slice_count_before < len(
         
     | 
| 
      
 280 
     | 
    
         
            +
                            self._concurrent_state["slices"]
         
     | 
| 
      
 281 
     | 
    
         
            +
                        ):  # only emit if at least one slice has been processed
         
     | 
| 
      
 282 
     | 
    
         
            +
                            self._merge_partitions()
         
     | 
| 
      
 283 
     | 
    
         
            +
                            self._emit_state_message()
         
     | 
| 
       284 
284 
     | 
    
         
             
                    self._has_closed_at_least_one_slice = True
         
     | 
| 
       285 
285 
     | 
    
         | 
| 
       286 
286 
     | 
    
         
             
                def _add_slice_to_state(self, partition: Partition) -> None:
         
     | 
| 
         @@ -60,7 +60,7 @@ class PartitionReader: 
     | 
|
| 
       60 
60 
     | 
    
         
             
                    self._queue = queue
         
     | 
| 
       61 
61 
     | 
    
         
             
                    self._partition_logger = partition_logger
         
     | 
| 
       62 
62 
     | 
    
         | 
| 
       63 
     | 
    
         
            -
                def process_partition(self, partition: Partition) -> None:
         
     | 
| 
      
 63 
     | 
    
         
            +
                def process_partition(self, partition: Partition, cursor: Cursor) -> None:
         
     | 
| 
       64 
64 
     | 
    
         
             
                    """
         
     | 
| 
       65 
65 
     | 
    
         
             
                    Process a partition and put the records in the output queue.
         
     | 
| 
       66 
66 
     | 
    
         
             
                    When all the partitions are added to the queue, a sentinel is added to the queue to indicate that all the partitions have been generated.
         
     | 
| 
         @@ -78,6 +78,8 @@ class PartitionReader: 
     | 
|
| 
       78 
78 
     | 
    
         | 
| 
       79 
79 
     | 
    
         
             
                        for record in partition.read():
         
     | 
| 
       80 
80 
     | 
    
         
             
                            self._queue.put(record)
         
     | 
| 
      
 81 
     | 
    
         
            +
                            cursor.observe(record)
         
     | 
| 
      
 82 
     | 
    
         
            +
                        cursor.close_partition(partition)
         
     | 
| 
       81 
83 
     | 
    
         
             
                        self._queue.put(PartitionCompleteSentinel(partition, self._IS_SUCCESSFUL))
         
     | 
| 
       82 
84 
     | 
    
         
             
                    except Exception as e:
         
     | 
| 
       83 
85 
     | 
    
         
             
                        self._queue.put(StreamThreadException(e, partition.stream_name()))
         
     | 
| 
         @@ -97,7 +97,7 @@ airbyte_cdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 
     | 
|
| 
       97 
97 
     | 
    
         
             
            airbyte_cdk/sources/__init__.py,sha256=45J83QsFH3Wky3sVapZWg4C58R_i1thm61M06t2c1AQ,1156
         
     | 
| 
       98 
98 
     | 
    
         
             
            airbyte_cdk/sources/abstract_source.py,sha256=50vxEBRByiNhT4WJkiFvgM-C6PWqKSJgvuNC_aeg2cw,15547
         
     | 
| 
       99 
99 
     | 
    
         
             
            airbyte_cdk/sources/concurrent_source/__init__.py,sha256=3D_RJsxQfiLboSCDdNei1Iv-msRp3DXsas6E9kl7dXc,386
         
     | 
| 
       100 
     | 
    
         
            -
            airbyte_cdk/sources/concurrent_source/concurrent_read_processor.py,sha256= 
     | 
| 
      
 100 
     | 
    
         
            +
            airbyte_cdk/sources/concurrent_source/concurrent_read_processor.py,sha256=qUi9zRjSEOsu3k6niRFjVn4l29OOMZVstIUoqNLw4_k,12208
         
     | 
| 
       101 
101 
     | 
    
         
             
            airbyte_cdk/sources/concurrent_source/concurrent_source.py,sha256=2sdgOnWtvClZaibnfn4Yardv2Jjv_lfwMubublDl1ZY,8458
         
     | 
| 
       102 
102 
     | 
    
         
             
            airbyte_cdk/sources/concurrent_source/concurrent_source_adapter.py,sha256=f9PIRPWn2tXu0-bxVeYHL2vYdqCzZ_kgpHg5_Ep-cfQ,6103
         
     | 
| 
       103 
103 
     | 
    
         
             
            airbyte_cdk/sources/concurrent_source/partition_generation_completed_sentinel.py,sha256=z1t-rAZBsqVidv2fpUlPHE9JgyXsITuGk4AMu96mXSQ,696
         
     | 
| 
         @@ -353,13 +353,13 @@ airbyte_cdk/sources/streams/concurrent/abstract_stream_facade.py,sha256=QTry1QCB 
     | 
|
| 
       353 
353 
     | 
    
         
             
            airbyte_cdk/sources/streams/concurrent/adapters.py,sha256=h4ZewhWn2PzPTt0lZZjcUL4rrpW9E_of7prnI3bm-c4,14004
         
     | 
| 
       354 
354 
     | 
    
         
             
            airbyte_cdk/sources/streams/concurrent/availability_strategy.py,sha256=M0XmvF3vjlr4GbCM0XH1hAj7udiAONM9SnmXjqufzLM,1035
         
     | 
| 
       355 
355 
     | 
    
         
             
            airbyte_cdk/sources/streams/concurrent/clamping.py,sha256=i26GVyui2ScEXSP-IP_61K2HaTp1-6lTlYHsZVYpuZA,3240
         
     | 
| 
       356 
     | 
    
         
            -
            airbyte_cdk/sources/streams/concurrent/cursor.py,sha256= 
     | 
| 
      
 356 
     | 
    
         
            +
            airbyte_cdk/sources/streams/concurrent/cursor.py,sha256=oEcqUyswPyOg6SnjrFr8c8YYxVvaaInWNCHRLQcKjmk,25713
         
     | 
| 
       357 
357 
     | 
    
         
             
            airbyte_cdk/sources/streams/concurrent/cursor_types.py,sha256=ZyWLPpeLX1qXcP5MwS-wxK11IBMsnVPCw9zx8gA2_Ro,843
         
     | 
| 
       358 
358 
     | 
    
         
             
            airbyte_cdk/sources/streams/concurrent/default_stream.py,sha256=SSufbo5f7OOYS8DZaABXeJVvodcfp9wb8J9lT5Xik3s,4744
         
     | 
| 
       359 
359 
     | 
    
         
             
            airbyte_cdk/sources/streams/concurrent/exceptions.py,sha256=JOZ446MCLpmF26r9KfS6OO_6rGjcjgJNZdcw6jccjEI,468
         
     | 
| 
       360 
360 
     | 
    
         
             
            airbyte_cdk/sources/streams/concurrent/helpers.py,sha256=S6AW8TgIASCZ2UuUcQLE8OzgYUHWt2-KPOvNPwnQf-Q,1596
         
     | 
| 
       361 
361 
     | 
    
         
             
            airbyte_cdk/sources/streams/concurrent/partition_enqueuer.py,sha256=2t64b_z9cEPmlHZnjSiMTO8PEtEdiAJDG0JcYOtUqAE,3363
         
     | 
| 
       362 
     | 
    
         
            -
            airbyte_cdk/sources/streams/concurrent/partition_reader.py,sha256= 
     | 
| 
      
 362 
     | 
    
         
            +
            airbyte_cdk/sources/streams/concurrent/partition_reader.py,sha256=qKd1NBlAjwo4mRVq9bowWr7oYg8SpgISklpkjUkie4k,3434
         
     | 
| 
       363 
363 
     | 
    
         
             
            airbyte_cdk/sources/streams/concurrent/partitions/__init__.py,sha256=4Hw-PX1-VgESLF16cDdvuYCzGJtHntThLF4qIiULWeo,61
         
     | 
| 
       364 
364 
     | 
    
         
             
            airbyte_cdk/sources/streams/concurrent/partitions/partition.py,sha256=CmaRcKn8y118No3qvbRV9DBeAUKv17lrVgloR4Y9TwU,1490
         
     | 
| 
       365 
365 
     | 
    
         
             
            airbyte_cdk/sources/streams/concurrent/partitions/partition_generator.py,sha256=_ymkkBr71_qt1fW0_MUqw96OfNBkeJngXQ09yolEDHw,441
         
     | 
| 
         @@ -459,9 +459,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G 
     | 
|
| 
       459 
459 
     | 
    
         
             
            airbyte_cdk/utils/spec_schema_transformations.py,sha256=9YDJmnIGFsT51CVQf2tSSvTapGimITjEFGbUTSZAGTI,963
         
     | 
| 
       460 
460 
     | 
    
         
             
            airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
         
     | 
| 
       461 
461 
     | 
    
         
             
            airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
         
     | 
| 
       462 
     | 
    
         
            -
            airbyte_cdk-7.3.10. 
     | 
| 
       463 
     | 
    
         
            -
            airbyte_cdk-7.3.10. 
     | 
| 
       464 
     | 
    
         
            -
            airbyte_cdk-7.3.10. 
     | 
| 
       465 
     | 
    
         
            -
            airbyte_cdk-7.3.10. 
     | 
| 
       466 
     | 
    
         
            -
            airbyte_cdk-7.3.10. 
     | 
| 
       467 
     | 
    
         
            -
            airbyte_cdk-7.3.10. 
     | 
| 
      
 462 
     | 
    
         
            +
            airbyte_cdk-7.3.10.dev1.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
         
     | 
| 
      
 463 
     | 
    
         
            +
            airbyte_cdk-7.3.10.dev1.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
         
     | 
| 
      
 464 
     | 
    
         
            +
            airbyte_cdk-7.3.10.dev1.dist-info/METADATA,sha256=bvjwnf74XFA0S4OlK94jZ1DtqdGMLCjqp5EK_RpT25c,6765
         
     | 
| 
      
 465 
     | 
    
         
            +
            airbyte_cdk-7.3.10.dev1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
         
     | 
| 
      
 466 
     | 
    
         
            +
            airbyte_cdk-7.3.10.dev1.dist-info/entry_points.txt,sha256=eLZ2UYvJZGm1s07Pplcs--1Gim60YhZWTb53j_dghwU,195
         
     | 
| 
      
 467 
     | 
    
         
            +
            airbyte_cdk-7.3.10.dev1.dist-info/RECORD,,
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     |