airbyte-cdk 6.51.0.post4.dev15422454178__py3-none-any.whl → 6.51.0.post6.dev15454977850__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.
@@ -295,16 +295,20 @@ class ConcurrentPerPartitionCursor(Cursor):
295
295
  ):
296
296
  self._partition_parent_state_map[partition_key] = (deepcopy(parent_state), seq)
297
297
 
298
- for cursor_slice, is_last_slice, _ in iterate_with_last_flag_and_state(
299
- cursor.stream_slices(),
300
- lambda: None,
301
- ):
302
- self._semaphore_per_partition[partition_key].release()
303
- if is_last_slice:
304
- self._partitions_done_generating_stream_slices.add(partition_key)
305
- yield StreamSlice(
306
- partition=partition, cursor_slice=cursor_slice, extra_fields=partition.extra_fields
307
- )
298
+ try:
299
+ for cursor_slice, is_last_slice, _ in iterate_with_last_flag_and_state(
300
+ cursor.stream_slices(),
301
+ lambda: None,
302
+ ):
303
+ self._semaphore_per_partition[partition_key].release()
304
+ if is_last_slice:
305
+ self._partitions_done_generating_stream_slices.add(partition_key)
306
+ yield StreamSlice(
307
+ partition=partition, cursor_slice=cursor_slice, extra_fields=partition.extra_fields
308
+ )
309
+ finally:
310
+ del cursor
311
+ del partition
308
312
 
309
313
  def _ensure_partition_limit(self) -> None:
310
314
  """
@@ -492,11 +496,10 @@ class ConcurrentPerPartitionCursor(Cursor):
492
496
  def _create_cursor(
493
497
  self, cursor_state: Any, runtime_lookback_window: int = 0
494
498
  ) -> ConcurrentCursor:
495
- cursor = self._cursor_factory.create(
499
+ return self._cursor_factory.create(
496
500
  stream_state=deepcopy(cursor_state),
497
501
  runtime_lookback_window=timedelta(seconds=runtime_lookback_window),
498
502
  )
499
- return cursor
500
503
 
501
504
  def should_be_synced(self, record: Record) -> bool:
502
505
  return self._get_cursor(record).should_be_synced(record)
@@ -511,8 +514,7 @@ class ConcurrentPerPartitionCursor(Cursor):
511
514
  raise ValueError(
512
515
  "Invalid state as stream slices that are emitted should refer to an existing cursor"
513
516
  )
514
- cursor = self._cursor_per_partition[partition_key]
515
- return cursor
517
+ return self._cursor_per_partition[partition_key]
516
518
 
517
519
  def limit_reached(self) -> bool:
518
520
  return self._number_of_partitions > self.SWITCH_TO_GLOBAL_LIMIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.51.0.post4.dev15422454178
3
+ Version: 6.51.0.post6.dev15454977850
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -111,7 +111,7 @@ airbyte_cdk/sources/declarative/extractors/record_selector.py,sha256=vCpwX1PVRFP
111
111
  airbyte_cdk/sources/declarative/extractors/response_to_file_extractor.py,sha256=WJyA2OYIEgFpVP5Y3o0tIj69AV6IKkn9B16MeXaEItI,6513
112
112
  airbyte_cdk/sources/declarative/extractors/type_transformer.py,sha256=d6Y2Rfg8pMVEEnHllfVksWZdNVOU55yk34O03dP9muY,1626
113
113
  airbyte_cdk/sources/declarative/incremental/__init__.py,sha256=U1oZKtBaEC6IACmvziY9Wzg7Z8EgF4ZuR7NwvjlB_Sk,1255
114
- airbyte_cdk/sources/declarative/incremental/concurrent_partition_cursor.py,sha256=vFMFp9OdYMie3tFpK_lfLsQtHhH8sQD5l6NJqj0DCX4,22593
114
+ airbyte_cdk/sources/declarative/incremental/concurrent_partition_cursor.py,sha256=yhF9vgcZ8ZuIFk3kN9pFcKkvkmhH8ksVKLt9CELDvk4,22664
115
115
  airbyte_cdk/sources/declarative/incremental/datetime_based_cursor.py,sha256=Rbe6lJLTtZ5en33MwZiB9-H9-AwDMNHgwBZs8EqhYqk,22172
116
116
  airbyte_cdk/sources/declarative/incremental/declarative_cursor.py,sha256=5Bhw9VRPyIuCaD0wmmq_L3DZsa-rJgtKSEUzSd8YYD0,536
117
117
  airbyte_cdk/sources/declarative/incremental/global_substream_cursor.py,sha256=2tsE6FgXzemf4fZZ4uGtd8QpRBl9GJ2CRqSNJE5p0EI,16077
@@ -419,9 +419,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
419
419
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
420
420
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
421
421
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
422
- airbyte_cdk-6.51.0.post4.dev15422454178.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
423
- airbyte_cdk-6.51.0.post4.dev15422454178.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
424
- airbyte_cdk-6.51.0.post4.dev15422454178.dist-info/METADATA,sha256=NYMHVBAElSCbpd0xpAoFVofyWEX43t_Uwxave4R6G4E,6364
425
- airbyte_cdk-6.51.0.post4.dev15422454178.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
426
- airbyte_cdk-6.51.0.post4.dev15422454178.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
427
- airbyte_cdk-6.51.0.post4.dev15422454178.dist-info/RECORD,,
422
+ airbyte_cdk-6.51.0.post6.dev15454977850.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
423
+ airbyte_cdk-6.51.0.post6.dev15454977850.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
424
+ airbyte_cdk-6.51.0.post6.dev15454977850.dist-info/METADATA,sha256=h8_PGrUcZOMcG1FRjKAzT8vtsjyAmZcN6miu6yosbok,6364
425
+ airbyte_cdk-6.51.0.post6.dev15454977850.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
426
+ airbyte_cdk-6.51.0.post6.dev15454977850.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
427
+ airbyte_cdk-6.51.0.post6.dev15454977850.dist-info/RECORD,,