airbyte-cdk 6.60.1__py3-none-any.whl → 6.60.2__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.
@@ -429,17 +429,6 @@ class DatetimeBasedCursor(DeclarativeCursor):
429
429
  )
430
430
  )
431
431
 
432
- def is_greater_than_or_equal(self, first: Record, second: Record) -> bool:
433
- cursor_field = self.cursor_field.eval(self.config) # type: ignore # cursor_field is converted to an InterpolatedString in __post_init__
434
- first_cursor_value = first.get(cursor_field)
435
- second_cursor_value = second.get(cursor_field)
436
- if first_cursor_value and second_cursor_value:
437
- return self.parse_date(first_cursor_value) >= self.parse_date(second_cursor_value)
438
- elif first_cursor_value:
439
- return True
440
- else:
441
- return False
442
-
443
432
  def set_runtime_lookback_window(self, lookback_window_in_seconds: int) -> None:
444
433
  """
445
434
  Updates the lookback window based on a given number of seconds if the new duration
@@ -338,12 +338,6 @@ class GlobalSubstreamCursor(DeclarativeCursor):
338
338
  def should_be_synced(self, record: Record) -> bool:
339
339
  return self._stream_cursor.should_be_synced(self._convert_record_to_cursor_record(record))
340
340
 
341
- def is_greater_than_or_equal(self, first: Record, second: Record) -> bool:
342
- return self._stream_cursor.is_greater_than_or_equal(
343
- self._convert_record_to_cursor_record(first),
344
- self._convert_record_to_cursor_record(second),
345
- )
346
-
347
341
  @staticmethod
348
342
  def _convert_record_to_cursor_record(record: Record) -> Record:
349
343
  return Record(
@@ -315,21 +315,6 @@ class PerPartitionCursor(DeclarativeCursor):
315
315
  self._convert_record_to_cursor_record(record)
316
316
  )
317
317
 
318
- def is_greater_than_or_equal(self, first: Record, second: Record) -> bool:
319
- if not first.associated_slice or not second.associated_slice:
320
- raise ValueError(
321
- f"Both records should have an associated slice but got {first.associated_slice} and {second.associated_slice}"
322
- )
323
- if first.associated_slice.partition != second.associated_slice.partition:
324
- raise ValueError(
325
- f"To compare records, partition should be the same but got {first.associated_slice.partition} and {second.associated_slice.partition}"
326
- )
327
-
328
- return self._get_cursor(first).is_greater_than_or_equal(
329
- self._convert_record_to_cursor_record(first),
330
- self._convert_record_to_cursor_record(second),
331
- )
332
-
333
318
  @staticmethod
334
319
  def _convert_record_to_cursor_record(record: Record) -> Record:
335
320
  return Record(
@@ -195,6 +195,3 @@ class PerPartitionWithGlobalCursor(DeclarativeCursor):
195
195
 
196
196
  def should_be_synced(self, record: Record) -> bool:
197
197
  return self._get_active_cursor().should_be_synced(record)
198
-
199
- def is_greater_than_or_equal(self, first: Record, second: Record) -> bool:
200
- return self._global_cursor.is_greater_than_or_equal(first, second)
@@ -42,12 +42,6 @@ class ResumableFullRefreshCursor(DeclarativeCursor):
42
42
  """
43
43
  return True
44
44
 
45
- def is_greater_than_or_equal(self, first: Record, second: Record) -> bool:
46
- """
47
- RFR record don't have ordering to be compared between one another.
48
- """
49
- return False
50
-
51
45
  def select_state(self, stream_slice: Optional[StreamSlice] = None) -> Optional[StreamState]:
52
46
  # A top-level RFR cursor only manages the state of a single partition
53
47
  return self._cursor
@@ -41,7 +41,6 @@ from airbyte_cdk.sources.declarative.requesters.request_options import (
41
41
  from airbyte_cdk.sources.declarative.requesters.requester import Requester
42
42
  from airbyte_cdk.sources.declarative.retrievers.retriever import Retriever
43
43
  from airbyte_cdk.sources.declarative.stream_slicers.stream_slicer import StreamSlicer
44
- from airbyte_cdk.sources.http_logger import format_http_message
45
44
  from airbyte_cdk.sources.source import ExperimentalClassWarning
46
45
  from airbyte_cdk.sources.streams.core import StreamData
47
46
  from airbyte_cdk.sources.types import Config, Record, StreamSlice, StreamState
@@ -528,35 +527,13 @@ class SimpleRetriever(Retriever):
528
527
  if self.cursor and current_record:
529
528
  self.cursor.observe(_slice, current_record)
530
529
 
531
- # Latest record read, not necessarily within slice boundaries.
532
- # TODO Remove once all custom components implement `observe` method.
533
- # https://github.com/airbytehq/airbyte-internal-issues/issues/6955
534
- most_recent_record_from_slice = self._get_most_recent_record(
535
- most_recent_record_from_slice, current_record, _slice
536
- )
537
530
  yield stream_data
538
531
 
539
532
  if self.cursor:
540
- self.cursor.close_slice(_slice, most_recent_record_from_slice)
533
+ self.cursor.close_slice(_slice)
541
534
  return
542
535
 
543
- def _get_most_recent_record(
544
- self,
545
- current_most_recent: Optional[Record],
546
- current_record: Optional[Record],
547
- stream_slice: StreamSlice,
548
- ) -> Optional[Record]:
549
- if self.cursor and current_record:
550
- if not current_most_recent:
551
- return current_record
552
- else:
553
- return (
554
- current_most_recent
555
- if self.cursor.is_greater_than_or_equal(current_most_recent, current_record)
556
- else current_record
557
- )
558
- else:
559
- return None
536
+ # FIXME based on the comment above in SimpleRetriever.read_records, it seems like we can tackle https://github.com/airbytehq/airbyte-internal-issues/issues/6955 and remove this
560
537
 
561
538
  def _extract_record(
562
539
  self, stream_data: StreamData, stream_slice: StreamSlice
@@ -62,12 +62,6 @@ class Cursor(ABC):
62
62
  Evaluating if a record should be synced allows for filtering and stop condition on pagination
63
63
  """
64
64
 
65
- @abstractmethod
66
- def is_greater_than_or_equal(self, first: Record, second: Record) -> bool:
67
- """
68
- Evaluating which record is greater in terms of cursor. This is used to avoid having to capture all the records to close a slice
69
- """
70
-
71
65
  @abstractmethod
72
66
  def select_state(self, stream_slice: Optional[StreamSlice] = None) -> Optional[StreamState]:
73
67
  """
@@ -40,12 +40,6 @@ class ResumableFullRefreshCursor(Cursor):
40
40
  """
41
41
  return True
42
42
 
43
- def is_greater_than_or_equal(self, first: Record, second: Record) -> bool:
44
- """
45
- RFR record don't have ordering to be compared between one another.
46
- """
47
- return False
48
-
49
43
  def select_state(self, stream_slice: Optional[StreamSlice] = None) -> Optional[StreamState]:
50
44
  # A top-level RFR cursor only manages the state of a single partition
51
45
  return self._cursor
@@ -89,12 +89,6 @@ class SubstreamResumableFullRefreshCursor(Cursor):
89
89
  """
90
90
  return True
91
91
 
92
- def is_greater_than_or_equal(self, first: Record, second: Record) -> bool:
93
- """
94
- RFR record don't have ordering to be compared between one another.
95
- """
96
- return False
97
-
98
92
  def select_state(self, stream_slice: Optional[StreamSlice] = None) -> Optional[StreamState]:
99
93
  if not stream_slice:
100
94
  raise ValueError("A partition needs to be provided in order to extract a state")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.60.1
3
+ Version: 6.60.2
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -113,12 +113,12 @@ airbyte_cdk/sources/declarative/extractors/response_to_file_extractor.py,sha256=
113
113
  airbyte_cdk/sources/declarative/extractors/type_transformer.py,sha256=d6Y2Rfg8pMVEEnHllfVksWZdNVOU55yk34O03dP9muY,1626
114
114
  airbyte_cdk/sources/declarative/incremental/__init__.py,sha256=U1oZKtBaEC6IACmvziY9Wzg7Z8EgF4ZuR7NwvjlB_Sk,1255
115
115
  airbyte_cdk/sources/declarative/incremental/concurrent_partition_cursor.py,sha256=cmv_nV1G3HMf-YUKtm6Pb2pbisx3R0ZnP_B-8cTnn0I,22842
116
- airbyte_cdk/sources/declarative/incremental/datetime_based_cursor.py,sha256=Rbe6lJLTtZ5en33MwZiB9-H9-AwDMNHgwBZs8EqhYqk,22172
116
+ airbyte_cdk/sources/declarative/incremental/datetime_based_cursor.py,sha256=AD5qJSryosA9p3rzdl_vX60uwG9_mOk5Q8sGD8XSTjE,21592
117
117
  airbyte_cdk/sources/declarative/incremental/declarative_cursor.py,sha256=5Bhw9VRPyIuCaD0wmmq_L3DZsa-rJgtKSEUzSd8YYD0,536
118
- airbyte_cdk/sources/declarative/incremental/global_substream_cursor.py,sha256=2tsE6FgXzemf4fZZ4uGtd8QpRBl9GJ2CRqSNJE5p0EI,16077
119
- airbyte_cdk/sources/declarative/incremental/per_partition_cursor.py,sha256=9IAJTCiRUXvhFFz-IhZtYh_KfAjLHqthsYf2jErQRls,17728
120
- airbyte_cdk/sources/declarative/incremental/per_partition_with_global.py,sha256=2YBOA2NnwAeIKlIhSwUB_W-FaGnPcmrG_liY7b4mV2Y,8365
121
- airbyte_cdk/sources/declarative/incremental/resumable_full_refresh_cursor.py,sha256=10LFv1QPM-agVKl6eaANmEBOfd7gZgBrkoTcMggsieQ,4809
118
+ airbyte_cdk/sources/declarative/incremental/global_substream_cursor.py,sha256=69XbGqqTHBCSXi4MV6qO7uTEsTUPRN7uML0VJDjl8qU,15809
119
+ airbyte_cdk/sources/declarative/incremental/per_partition_cursor.py,sha256=DW56OT7H6_lE2CZagXitaSv8B9pAB6P78Y5TSI5qHBg,16937
120
+ airbyte_cdk/sources/declarative/incremental/per_partition_with_global.py,sha256=rjsH7XwrJON5lXVfU0FIrEGglNesVzlr8hfwS5_A9sY,8210
121
+ airbyte_cdk/sources/declarative/incremental/resumable_full_refresh_cursor.py,sha256=I8AwJkbl9AKbYYqwZUSP7hLoRMMuNkDQ90Zv5Z7CWdo,4609
122
122
  airbyte_cdk/sources/declarative/interpolation/__init__.py,sha256=Kh7FxhfetyNVDnAQ9zSxNe4oUbb8CvoW7Mqz7cs2iPg,437
123
123
  airbyte_cdk/sources/declarative/interpolation/filters.py,sha256=cYap5zzOxIJWCLIfbkNlpyfUhjZ8FklLroIG4WGzYVs,5537
124
124
  airbyte_cdk/sources/declarative/interpolation/interpolated_boolean.py,sha256=8F3ntT_Mfo8cO9n6dCq8rTfJIpfKmzRCsVtVdhzaoGc,1964
@@ -209,7 +209,7 @@ airbyte_cdk/sources/declarative/retrievers/file_uploader/file_writer.py,sha256=V
209
209
  airbyte_cdk/sources/declarative/retrievers/file_uploader/local_file_system_file_writer.py,sha256=jLpdonre1UHfbjGSD5AK_T0codLABJByTvbqepDZtEQ,422
210
210
  airbyte_cdk/sources/declarative/retrievers/file_uploader/noop_file_writer.py,sha256=1yfimzxm09d2j605cu_HhiYVDNVL1rUMi3vs_jYlIyY,330
211
211
  airbyte_cdk/sources/declarative/retrievers/retriever.py,sha256=XPLs593Xv8c5cKMc37XzUAYmzlXd1a7eSsspM-CMuWA,1696
212
- airbyte_cdk/sources/declarative/retrievers/simple_retriever.py,sha256=ma6ZkDdf89ECdT1Lg0Y5p0VjzjwJG4JVC_bz8KbfI7I,28431
212
+ airbyte_cdk/sources/declarative/retrievers/simple_retriever.py,sha256=1-owE0r2RA8AsP8Yc6CVjNRNodMcOFl0RBCgCJY5MAY,27505
213
213
  airbyte_cdk/sources/declarative/schema/__init__.py,sha256=xU45UvM5O4c1PSM13UHpCdh5hpW3HXy9vRRGEiAC1rg,795
214
214
  airbyte_cdk/sources/declarative/schema/composite_schema_loader.py,sha256=ymGbvxS_QyGc4nnjEyRo5ch8bVedELO41PAUxKXZyMw,1113
215
215
  airbyte_cdk/sources/declarative/schema/default_schema_loader.py,sha256=UnbzlExmwoQiVV8zDg4lhAEaqA_0pRfwbMRe8yqOuWk,1834
@@ -308,10 +308,10 @@ airbyte_cdk/sources/streams/availability_strategy.py,sha256=_RU4JITrxMEN36g1RDHM
308
308
  airbyte_cdk/sources/streams/call_rate.py,sha256=jRsGp1PDZBCDQNxzcGVnVmVzLk0wLHxS1JnJwMAgy9U,27568
309
309
  airbyte_cdk/sources/streams/checkpoint/__init__.py,sha256=3oy7Hd4ivVWTZlN6dKAf4Fv_G7U5iZrvhO9hT871UIo,712
310
310
  airbyte_cdk/sources/streams/checkpoint/checkpoint_reader.py,sha256=6HMT2NI-FQuaW0nt95NcyWrt5rZN4gF-Arx0sxdgbv4,15221
311
- airbyte_cdk/sources/streams/checkpoint/cursor.py,sha256=3e-3c-54k8U7Awno7DMmAD9ndbnl9OM48EnbEgeDUO0,3499
311
+ airbyte_cdk/sources/streams/checkpoint/cursor.py,sha256=FrfDRRzsBvpu9H9qgUUeULz1LTcWIeghf_rWpffTgWk,3239
312
312
  airbyte_cdk/sources/streams/checkpoint/per_partition_key_serializer.py,sha256=_mtH3_XcpASeu_z2WnAFrXqwKaPBMuXvZlVHSpLVqa8,1074
313
- airbyte_cdk/sources/streams/checkpoint/resumable_full_refresh_cursor.py,sha256=9si8btC8XQzHA9i2tv9vO1k-cBeyUhpfC-kePn0VNmc,1966
314
- airbyte_cdk/sources/streams/checkpoint/substream_resumable_full_refresh_cursor.py,sha256=qyTpIpVh7c1ptwZ9S-2sMoRHh4prpQAlzqjweQ5iCxM,4769
313
+ airbyte_cdk/sources/streams/checkpoint/resumable_full_refresh_cursor.py,sha256=GV9GIBbxwP1-_fy3qTRnNccFDRls_P0KnTVODF9C8_U,1766
314
+ airbyte_cdk/sources/streams/checkpoint/substream_resumable_full_refresh_cursor.py,sha256=qydclrks-hHJ9B9wOKvbu_FZXJOFiB3yD5U4KwsX80Y,4569
315
315
  airbyte_cdk/sources/streams/concurrent/README.md,sha256=0nvgnlCBfZJiPDAofT8yFmUhGc4L99RCb3fL_PI4sSY,1070
316
316
  airbyte_cdk/sources/streams/concurrent/__init__.py,sha256=4Hw-PX1-VgESLF16cDdvuYCzGJtHntThLF4qIiULWeo,61
317
317
  airbyte_cdk/sources/streams/concurrent/abstract_stream.py,sha256=3OB5VsvOkJmCxIMABKgdJAwvCdZtkxeaAVrUNIW3jMQ,3902
@@ -424,9 +424,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
424
424
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
425
425
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
426
426
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
427
- airbyte_cdk-6.60.1.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
428
- airbyte_cdk-6.60.1.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
429
- airbyte_cdk-6.60.1.dist-info/METADATA,sha256=5EwrpWPTO4Mv4T4pHFBEcV-aNmvM1UdBh-VULLQwhCc,6477
430
- airbyte_cdk-6.60.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
431
- airbyte_cdk-6.60.1.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
432
- airbyte_cdk-6.60.1.dist-info/RECORD,,
427
+ airbyte_cdk-6.60.2.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
428
+ airbyte_cdk-6.60.2.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
429
+ airbyte_cdk-6.60.2.dist-info/METADATA,sha256=2R0g94kHNGz_zqFekW1FmfAhdU3CAO2oATRK49i0av4,6477
430
+ airbyte_cdk-6.60.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
431
+ airbyte_cdk-6.60.2.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
432
+ airbyte_cdk-6.60.2.dist-info/RECORD,,