ingestr 0.12.7__py3-none-any.whl → 0.12.8__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.

Potentially problematic release.


This version of ingestr might be problematic. Click here for more details.

@@ -56,6 +56,11 @@ def adjust_source(
56
56
  filters=filters,
57
57
  )
58
58
 
59
+ @dlt.resource(write_disposition="replace", primary_key="id")
60
+ def events():
61
+ adjust_api = AdjustAPI(api_key=api_key)
62
+ yield adjust_api.fetch_events()
63
+
59
64
  @dlt.resource(write_disposition="merge", merge_key="day")
60
65
  def creatives():
61
66
  adjust_api = AdjustAPI(api_key=api_key)
@@ -68,7 +73,7 @@ def adjust_source(
68
73
  )
69
74
 
70
75
  if not dimensions:
71
- return campaigns, creatives
76
+ return campaigns, creatives, events
72
77
 
73
78
  merge_key = merge_key
74
79
  type_hints = {}
@@ -100,4 +105,4 @@ def adjust_source(
100
105
  filters=filters,
101
106
  )
102
107
 
103
- return campaigns, creatives, custom
108
+ return campaigns, creatives, custom, events
@@ -28,10 +28,20 @@ DEFAULT_METRICS = [
28
28
  ]
29
29
 
30
30
 
31
+ def retry_on_limit(response: requests.Response, exception: BaseException) -> bool:
32
+ return response.status_code == 429
33
+
34
+
31
35
  class AdjustAPI:
32
36
  def __init__(self, api_key):
33
37
  self.api_key = api_key
34
- self.uri = "https://automate.adjust.com/reports-service/report"
38
+ self.request_client = Client(
39
+ request_timeout=8.0,
40
+ raise_for_status=False,
41
+ retry_condition=retry_on_limit,
42
+ request_max_attempts=12,
43
+ request_backoff_factor=2,
44
+ ).session
35
45
 
36
46
  def fetch_report_data(
37
47
  self,
@@ -62,20 +72,11 @@ class AdjustAPI:
62
72
  f"Invalid date range: Start date ({start_date}) must be earlier than end date ({end_date})."
63
73
  )
64
74
 
65
- def retry_on_limit(
66
- response: requests.Response, exception: BaseException
67
- ) -> bool:
68
- return response.status_code == 429
69
-
70
- request_client = Client(
71
- request_timeout=8.0,
72
- raise_for_status=False,
73
- retry_condition=retry_on_limit,
74
- request_max_attempts=12,
75
- request_backoff_factor=2,
76
- ).session
77
-
78
- response = request_client.get(self.uri, headers=headers, params=params)
75
+ response = self.request_client.get(
76
+ "https://automate.adjust.com/reports-service/report",
77
+ headers=headers,
78
+ params=params,
79
+ )
79
80
  if response.status_code == 200:
80
81
  result = response.json()
81
82
  items = result.get("rows", [])
@@ -83,6 +84,17 @@ class AdjustAPI:
83
84
  else:
84
85
  raise HTTPError(f"Request failed with status code: {response.status_code}")
85
86
 
87
+ def fetch_events(self):
88
+ headers = {"Authorization": f"Bearer {self.api_key}"}
89
+ response = self.request_client.get(
90
+ "https://automate.adjust.com/reports-service/events", headers=headers
91
+ )
92
+ if response.status_code == 200:
93
+ result = response.json()
94
+ yield result
95
+ else:
96
+ raise HTTPError(f"Request failed with status code: {response.status_code}")
97
+
86
98
 
87
99
  def parse_filters(filters_raw: str) -> dict:
88
100
  # Parse filter string like "key1=value1,key2=value2,value3,value4"
ingestr/src/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.12.7"
1
+ __version__ = "0.12.8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ingestr
3
- Version: 0.12.7
3
+ Version: 0.12.8
4
4
  Summary: ingestr is a command-line application that ingests data from various sources and stores them in any database.
5
5
  Project-URL: Homepage, https://github.com/bruin-data/ingestr
6
6
  Project-URL: Issues, https://github.com/bruin-data/ingestr/issues
@@ -7,9 +7,9 @@ ingestr/src/filters.py,sha256=0JQXeAr2APFMnW2sd-6BlAMWv93bXV17j8b5MM8sHmM,580
7
7
  ingestr/src/sources.py,sha256=dMXTfykbAZTN8SNpOWJbtl10krdJfg12S13at3Z4L38,53647
8
8
  ingestr/src/table_definition.py,sha256=REbAbqdlmUMUuRh8nEQRreWjPVOQ5ZcfqGkScKdCrmk,390
9
9
  ingestr/src/time.py,sha256=H_Fk2J4ShXyUM-EMY7MqCLZQhlnZMZvO952bmZPc4yE,254
10
- ingestr/src/version.py,sha256=WvcWmk-c-I-XXiq6oM9Y1VYwNWFe64tXpnG_RI47HhE,23
11
- ingestr/src/adjust/__init__.py,sha256=NaRNwDhItG8Q7vUHw7zQvyfWjmT32M0CSc5ufjmBM9U,3067
12
- ingestr/src/adjust/adjust_helpers.py,sha256=-tmmxy9k3wms-ZEIgxmlp2cAQ2X_O1lgjY1128bbMu4,3224
10
+ ingestr/src/version.py,sha256=F7xxYe0dXryqS1cGEXFikx8AI7-UsZzdi89hJdyx-b0,23
11
+ ingestr/src/adjust/__init__.py,sha256=ULjtJqrNS6XDvUyGl0tjl12-tLyXlCgeFe2icTbtu3Q,3255
12
+ ingestr/src/adjust/adjust_helpers.py,sha256=av97NPSn-hQtTbAC0vUSCAWYePmOiG5R-DGdMssm7FQ,3646
13
13
  ingestr/src/airtable/__init__.py,sha256=GHWYrjI2qhs_JihdNJysB0Ni3bzqT_MLXn_S9_Q5zRA,2775
14
14
  ingestr/src/appsflyer/_init_.py,sha256=ne2-9FQ654Drtd3GkKQv8Bwb6LEqCnJw49MfO5Jyzgs,739
15
15
  ingestr/src/appsflyer/client.py,sha256=TNmwakLzmO6DZW3wcfLfQRl7aNBHgFqSsk4ef-MmJ1w,3084
@@ -91,8 +91,8 @@ ingestr/testdata/delete_insert_part2.csv,sha256=B_KUzpzbNdDY_n7wWop1mT2cz36TmayS
91
91
  ingestr/testdata/merge_expected.csv,sha256=DReHqWGnQMsf2PBv_Q2pfjsgvikYFnf1zYcQZ7ZqYN0,276
92
92
  ingestr/testdata/merge_part1.csv,sha256=Pw8Z9IDKcNU0qQHx1z6BUf4rF_-SxKGFOvymCt4OY9I,185
93
93
  ingestr/testdata/merge_part2.csv,sha256=T_GiWxA81SN63_tMOIuemcvboEFeAmbKc7xRXvL9esw,287
94
- ingestr-0.12.7.dist-info/METADATA,sha256=5p9Igsh-xTJT1cNM_dsgAAFDTDuUQQSezkL9dz4JO3k,8024
95
- ingestr-0.12.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
96
- ingestr-0.12.7.dist-info/entry_points.txt,sha256=oPJy0KBnPWYjDtP1k8qwAihcTLHSZokSQvRAw_wtfJM,46
97
- ingestr-0.12.7.dist-info/licenses/LICENSE.md,sha256=cW8wIhn8HFE-KLStDF9jHQ1O_ARWP3kTpk_-eOccL24,1075
98
- ingestr-0.12.7.dist-info/RECORD,,
94
+ ingestr-0.12.8.dist-info/METADATA,sha256=zbhdTjqZrWDsmnXTxy1tfC79Q75vzHc-7UWLM62vocQ,8024
95
+ ingestr-0.12.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
96
+ ingestr-0.12.8.dist-info/entry_points.txt,sha256=oPJy0KBnPWYjDtP1k8qwAihcTLHSZokSQvRAw_wtfJM,46
97
+ ingestr-0.12.8.dist-info/licenses/LICENSE.md,sha256=cW8wIhn8HFE-KLStDF9jHQ1O_ARWP3kTpk_-eOccL24,1075
98
+ ingestr-0.12.8.dist-info/RECORD,,