airbyte-source-iterable 0.5.1.dev202405100143__py3-none-any.whl → 0.5.1.dev202405100257__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.dev202405100143
3
+ Version: 0.5.1.dev202405100257
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.88.1)
15
+ Requires-Dist: airbyte-cdk (==0.80.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)
@@ -1,5 +1,5 @@
1
1
  source_iterable/__init__.py,sha256=8WKQT800ggxG1vGPoA_ZHUkozwEM7qMhGMhzEPCdA4o,65
2
- source_iterable/components.py,sha256=dMNoGz58C49sWvvJXP57arccWa1z9BHyhMOj2_KDUTU,1374
2
+ source_iterable/components.py,sha256=dHp23THc43TmogP_tCxcv12mAgZSRs5fKir2ckr4hHI,1374
3
3
  source_iterable/manifest.yaml,sha256=uO7z-bIU6CtGms6IsLwjyZ-cb3tVY-vLUMLOZGkZDts,13996
4
4
  source_iterable/run.py,sha256=-Bvz772Z7iJWExDoJS7chxv725hG4e9e5Engrtp66iE,236
5
5
  source_iterable/schemas/campaigns.json,sha256=FONoPuz_4aRat8OZzhj7BcHFAqetpBYUDmOZfroCu7I,2494
@@ -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.dev202405100143.dist-info/METADATA,sha256=RdocwuPkwN0QYxbql02qCcFKd3A9Ym-KQ6R0etHEf0s,5378
29
- airbyte_source_iterable-0.5.1.dev202405100143.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
30
- airbyte_source_iterable-0.5.1.dev202405100143.dist-info/entry_points.txt,sha256=pjzrNtsOX3jW37IK0U5pSmLiraiuLTPr5aB5-hBXpAo,59
31
- airbyte_source_iterable-0.5.1.dev202405100143.dist-info/RECORD,,
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,,
@@ -7,7 +7,6 @@ from dataclasses import dataclass
7
7
  from io import StringIO
8
8
 
9
9
  import requests
10
- from typing import Iterable
11
10
  from airbyte_cdk.sources.declarative.extractors.dpath_extractor import DpathExtractor
12
11
  from airbyte_cdk.sources.declarative.types import Config, Record, StreamSlice, StreamState
13
12
 
@@ -15,26 +14,28 @@ from airbyte_cdk.sources.declarative.types import Config, Record, StreamSlice, S
15
14
  @dataclass
16
15
  class XJsonRecordExtractor(DpathExtractor):
17
16
  def extract_records(self, response: requests.Response) -> list[Record]:
18
- for record in response.iter_lines():
19
- yield json.loads(record)
17
+ return [json.loads(record) for record in response.iter_lines()]
20
18
 
21
19
 
22
20
  @dataclass
23
21
  class ListUsersRecordExtractor(DpathExtractor):
24
- def extract_records(self, response: requests.Response) -> Iterable[Record]:
25
- for record in response.iter_lines():
26
- yield {"email": record.decode()}
22
+ def extract_records(self, response: requests.Response) -> list[Record]:
23
+ return [{"email": record.decode()} for record in response.iter_lines()]
27
24
 
28
25
 
29
26
  @dataclass
30
27
  class EventsRecordExtractor(DpathExtractor):
31
28
  common_fields = ("itblInternal", "_type", "createdAt", "email")
32
29
 
33
- def extract_records(self, response: requests.Response) -> Iterable[Record]:
30
+ def extract_records(self, response: requests.Response) -> list[Record]:
34
31
  jsonl_records = StringIO(response.text)
32
+ records = []
35
33
  for record in jsonl_records:
36
34
  record_dict = json.loads(record)
37
35
  record_dict_common_fields = {}
38
36
  for field in self.common_fields:
39
37
  record_dict_common_fields[field] = record_dict.pop(field, None)
40
- yield {**record_dict_common_fields, "data": record_dict}
38
+
39
+ records.append({**record_dict_common_fields, "data": record_dict})
40
+
41
+ return records