airbyte-source-iterable 0.5.2__py3-none-any.whl → 0.5.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-source-iterable
3
- Version: 0.5.2
3
+ Version: 0.5.4
4
4
  Summary: Source implementation for Iterable.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3
12
12
  Classifier: Programming Language :: Python :: 3.9
13
13
  Classifier: Programming Language :: Python :: 3.10
14
14
  Classifier: Programming Language :: Python :: 3.11
15
- Requires-Dist: airbyte-cdk (==0.80.0)
15
+ Requires-Dist: airbyte-cdk (==0.90.0)
16
16
  Requires-Dist: pendulum (==2.1.2)
17
17
  Requires-Dist: python-dateutil (==2.8.2)
18
18
  Requires-Dist: requests (==2.31.0)
@@ -53,7 +53,7 @@ See `sample_files/sample_config.json` for a sample config file.
53
53
  poetry run source-iterable spec
54
54
  poetry run source-iterable check --config secrets/config.json
55
55
  poetry run source-iterable discover --config secrets/config.json
56
- poetry run source-iterable read --config secrets/config.json --catalog sample_files/configured_catalog.json
56
+ poetry run source-iterable read --config secrets/config.json --catalog integration_tests/configured_catalog.json
57
57
  ```
58
58
 
59
59
  ### Running unit tests
@@ -23,9 +23,9 @@ source_iterable/schemas/users.json,sha256=CHqA30cnsTXfI-M0n54NwVaaZEO12tt_IgQ9yP
23
23
  source_iterable/slice_generators.py,sha256=neRuWD52Xnr84KvWQ0kjaErR44sOKjxIyLCNeofohzE,6482
24
24
  source_iterable/source.py,sha256=AhZQ4L54VTo6jf2QltvFCqDNgqaPSEKCfR0GInCLEEc,4537
25
25
  source_iterable/spec.json,sha256=y5_YFTkPPtxjvzGtaZZql90Tc37fyZZpQKXFGPL_cYE,1009
26
- source_iterable/streams.py,sha256=ZEC8IqBrTeD2oYOvLL51E62iOsIOK3jiTN7pLI-CwRs,19468
26
+ source_iterable/streams.py,sha256=r6YZlquKUQCyoKlwdIOVMUCTCBLiQPS4POJKmuZD61s,19913
27
27
  source_iterable/utils.py,sha256=2oM8AjBZXs9nTG_PhSWmxBWEmp-w-tWFaxQQvAfUuMM,649
28
- airbyte_source_iterable-0.5.2.dist-info/METADATA,sha256=bwd6yztgKE8FL6GSq6ZyZ0sQGpbIlWKBETtBrvLg3-g,5362
29
- airbyte_source_iterable-0.5.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
30
- airbyte_source_iterable-0.5.2.dist-info/entry_points.txt,sha256=pjzrNtsOX3jW37IK0U5pSmLiraiuLTPr5aB5-hBXpAo,59
31
- airbyte_source_iterable-0.5.2.dist-info/RECORD,,
28
+ airbyte_source_iterable-0.5.4.dist-info/METADATA,sha256=D8TpwUdhCaTcLm8_2ekegSiPjRLeInbNii-upMDy_gk,5367
29
+ airbyte_source_iterable-0.5.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
30
+ airbyte_source_iterable-0.5.4.dist-info/entry_points.txt,sha256=pjzrNtsOX3jW37IK0U5pSmLiraiuLTPr5aB5-hBXpAo,59
31
+ airbyte_source_iterable-0.5.4.dist-info/RECORD,,
@@ -12,7 +12,7 @@ import pendulum
12
12
  import requests
13
13
  from airbyte_cdk.models import SyncMode
14
14
  from airbyte_cdk.sources.streams.availability_strategy import AvailabilityStrategy
15
- from airbyte_cdk.sources.streams.core import package_name_from_class
15
+ from airbyte_cdk.sources.streams.core import CheckpointMixin, package_name_from_class
16
16
  from airbyte_cdk.sources.streams.http import HttpStream
17
17
  from airbyte_cdk.sources.streams.http.exceptions import DefaultBackoffException, UserDefinedBackoffException
18
18
  from airbyte_cdk.sources.utils.schema_helpers import ResourceSchemaLoader
@@ -128,7 +128,7 @@ class IterableStream(HttpStream, ABC):
128
128
  raise e
129
129
 
130
130
 
131
- class IterableExportStream(IterableStream, ABC):
131
+ class IterableExportStream(IterableStream, CheckpointMixin, ABC):
132
132
  """
133
133
  This stream utilize "export" Iterable api for getting large amount of data.
134
134
  It can return data in form of new line separater strings each of each
@@ -143,6 +143,14 @@ class IterableExportStream(IterableStream, ABC):
143
143
  cursor_field = "createdAt"
144
144
  primary_key = None
145
145
 
146
+ @property
147
+ def state(self) -> MutableMapping[str, Any]:
148
+ return self._state
149
+
150
+ @state.setter
151
+ def state(self, value: MutableMapping[str, Any]):
152
+ self._state = value
153
+
146
154
  def __init__(self, start_date=None, end_date=None, **kwargs):
147
155
  super().__init__(**kwargs)
148
156
  self._start_date = pendulum.parse(start_date)
@@ -162,7 +170,12 @@ class IterableExportStream(IterableStream, ABC):
162
170
  raise ValueError(f"Unsupported type of datetime field {type(value)}")
163
171
  return value
164
172
 
165
- def get_updated_state(
173
+ def read_records(self, **kwargs) -> Iterable[Mapping[str, Any]]:
174
+ for record in super().read_records(**kwargs):
175
+ self.state = self._get_updated_state(self.state, record)
176
+ yield record
177
+
178
+ def _get_updated_state(
166
179
  self,
167
180
  current_stream_state: MutableMapping[str, Any],
168
181
  latest_record: Mapping[str, Any],