airbyte-source-iterable 0.5.1.dev202405100257__py3-none-any.whl → 0.5.1.dev202405100348__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.1.dev202405100257
3
+ Version: 0.5.1.dev202405100348
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.88.1)
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)
@@ -1,6 +1,6 @@
1
1
  source_iterable/__init__.py,sha256=8WKQT800ggxG1vGPoA_ZHUkozwEM7qMhGMhzEPCdA4o,65
2
- source_iterable/components.py,sha256=dHp23THc43TmogP_tCxcv12mAgZSRs5fKir2ckr4hHI,1374
3
- source_iterable/manifest.yaml,sha256=uO7z-bIU6CtGms6IsLwjyZ-cb3tVY-vLUMLOZGkZDts,13996
2
+ source_iterable/components.py,sha256=dMNoGz58C49sWvvJXP57arccWa1z9BHyhMOj2_KDUTU,1374
3
+ source_iterable/manifest.yaml,sha256=LzQOH3nELMn8MxkVcrNRWx9bXZbSBhiQj05fNl4ZY3M,13996
4
4
  source_iterable/run.py,sha256=-Bvz772Z7iJWExDoJS7chxv725hG4e9e5Engrtp66iE,236
5
5
  source_iterable/schemas/campaigns.json,sha256=FONoPuz_4aRat8OZzhj7BcHFAqetpBYUDmOZfroCu7I,2494
6
6
  source_iterable/schemas/campaigns_metrics.json,sha256=Aa6pNdVxHOG-LSxlLzhxFY8uIdfrPBTgX9QyWrLJ4Fs,168
@@ -25,7 +25,7 @@ source_iterable/source.py,sha256=AhZQ4L54VTo6jf2QltvFCqDNgqaPSEKCfR0GInCLEEc,453
25
25
  source_iterable/spec.json,sha256=y5_YFTkPPtxjvzGtaZZql90Tc37fyZZpQKXFGPL_cYE,1009
26
26
  source_iterable/streams.py,sha256=ZEC8IqBrTeD2oYOvLL51E62iOsIOK3jiTN7pLI-CwRs,19468
27
27
  source_iterable/utils.py,sha256=2oM8AjBZXs9nTG_PhSWmxBWEmp-w-tWFaxQQvAfUuMM,649
28
- airbyte_source_iterable-0.5.1.dev202405100257.dist-info/METADATA,sha256=pRzY36Ds6E6ooAeFOKSpoxr8hDA8tTUcnPApyfXsTCE,5378
29
- airbyte_source_iterable-0.5.1.dev202405100257.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
30
- airbyte_source_iterable-0.5.1.dev202405100257.dist-info/entry_points.txt,sha256=pjzrNtsOX3jW37IK0U5pSmLiraiuLTPr5aB5-hBXpAo,59
31
- airbyte_source_iterable-0.5.1.dev202405100257.dist-info/RECORD,,
28
+ airbyte_source_iterable-0.5.1.dev202405100348.dist-info/METADATA,sha256=LoOPh6fdYI_DE4zUVPj6xsxDHaE1gEoWU7An3Lt_fAw,5378
29
+ airbyte_source_iterable-0.5.1.dev202405100348.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
30
+ airbyte_source_iterable-0.5.1.dev202405100348.dist-info/entry_points.txt,sha256=pjzrNtsOX3jW37IK0U5pSmLiraiuLTPr5aB5-hBXpAo,59
31
+ airbyte_source_iterable-0.5.1.dev202405100348.dist-info/RECORD,,
@@ -7,6 +7,7 @@ from dataclasses import dataclass
7
7
  from io import StringIO
8
8
 
9
9
  import requests
10
+ from typing import Iterable
10
11
  from airbyte_cdk.sources.declarative.extractors.dpath_extractor import DpathExtractor
11
12
  from airbyte_cdk.sources.declarative.types import Config, Record, StreamSlice, StreamState
12
13
 
@@ -14,28 +15,26 @@ from airbyte_cdk.sources.declarative.types import Config, Record, StreamSlice, S
14
15
  @dataclass
15
16
  class XJsonRecordExtractor(DpathExtractor):
16
17
  def extract_records(self, response: requests.Response) -> list[Record]:
17
- return [json.loads(record) for record in response.iter_lines()]
18
+ for record in response.iter_lines():
19
+ yield json.loads(record)
18
20
 
19
21
 
20
22
  @dataclass
21
23
  class ListUsersRecordExtractor(DpathExtractor):
22
- def extract_records(self, response: requests.Response) -> list[Record]:
23
- return [{"email": record.decode()} for record in response.iter_lines()]
24
+ def extract_records(self, response: requests.Response) -> Iterable[Record]:
25
+ for record in response.iter_lines():
26
+ yield {"email": record.decode()}
24
27
 
25
28
 
26
29
  @dataclass
27
30
  class EventsRecordExtractor(DpathExtractor):
28
31
  common_fields = ("itblInternal", "_type", "createdAt", "email")
29
32
 
30
- def extract_records(self, response: requests.Response) -> list[Record]:
33
+ def extract_records(self, response: requests.Response) -> Iterable[Record]:
31
34
  jsonl_records = StringIO(response.text)
32
- records = []
33
35
  for record in jsonl_records:
34
36
  record_dict = json.loads(record)
35
37
  record_dict_common_fields = {}
36
38
  for field in self.common_fields:
37
39
  record_dict_common_fields[field] = record_dict.pop(field, None)
38
-
39
- records.append({**record_dict_common_fields, "data": record_dict})
40
-
41
- return records
40
+ yield {**record_dict_common_fields, "data": record_dict}
@@ -290,7 +290,7 @@ streams:
290
290
  partition_router: []
291
291
  primary_key: []
292
292
  incremental_sync:
293
- step: P90D
293
+ step: P30D
294
294
  type: DatetimeBasedCursor
295
295
  cursor_field: profileUpdatedAt
296
296
  end_datetime: