Skip to content

Commit 59adbe8

Browse files
bleonardlazebnyi
andauthored
source-amplitude: ensure inline schemas, updated cdk, poetry (where possible) (#36631)
Co-authored-by: Serhii Lazebnyi <[email protected]>
1 parent f9b576e commit 59adbe8

File tree

10 files changed

+299
-166
lines changed

10 files changed

+299
-166
lines changed

airbyte-integrations/connectors/source-amplitude/metadata.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ data:
1111
connectorSubtype: api
1212
connectorType: source
1313
definitionId: fa9f58c6-2d03-4237-aaa4-07d75e0c1396
14-
dockerImageTag: 0.3.8
14+
dockerImageTag: 0.3.10
1515
dockerRepository: airbyte/source-amplitude
1616
documentationUrl: https://docs.airbyte.com/integrations/sources/amplitude
1717
githubIssueLabel: source-amplitude

airbyte-integrations/connectors/source-amplitude/poetry.lock

+17-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

airbyte-integrations/connectors/source-amplitude/pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
33
build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
6-
version = "0.3.8"
6+
version = "0.3.10"
77
name = "source-amplitude"
88
description = "Source implementation for Amplitude."
99
authors = [ "Airbyte <[email protected]>",]
@@ -17,7 +17,7 @@ include = "source_amplitude"
1717

1818
[tool.poetry.dependencies]
1919
python = "^3.9,<3.12"
20-
airbyte-cdk = "^0"
20+
airbyte-cdk = "0.80.0"
2121

2222
[tool.poetry.scripts]
2323
source-amplitude = "source_amplitude.run:run"

airbyte-integrations/connectors/source-amplitude/source_amplitude/manifest.yaml

+219-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ definitions:
88
field_path: ["{{ parameters.get('data_field') }}"]
99
requester:
1010
type: HttpRequester
11-
url_base: "https://{{'analytics.eu.' if config['data_region'] == 'EU Residency Server' else '' }}amplitude.com/api"
11+
url_base:
12+
"https://{{'analytics.eu.' if config['data_region'] == 'EU Residency
13+
Server' else '' }}amplitude.com/api"
1214
http_method: "GET"
1315
authenticator:
1416
type: BasicHttpAuthenticator
@@ -19,16 +21,22 @@ definitions:
1921
response_filters:
2022
- http_codes: [400]
2123
action: FAIL
22-
error_message: The file size of the exported data is too large. Shorten the time ranges and try again. The limit size is 4GB.
24+
error_message:
25+
The file size of the exported data is too large. Shorten the
26+
time ranges and try again. The limit size is 4GB.
2327
- http_codes: [403]
2428
action: FAIL
25-
error_message: Access denied due to lack of permission or invalid API/Secret key or wrong data region.
29+
error_message:
30+
Access denied due to lack of permission or invalid API/Secret
31+
key or wrong data region.
2632
- http_codes: [404]
2733
action: IGNORE
2834
error_message: No data collected
2935
- http_codes: [504]
3036
action: FAIL
31-
error_message: The amount of data is large causing a timeout. For large amounts of data, the Amazon S3 destination is recommended.
37+
error_message:
38+
The amount of data is large causing a timeout. For large amounts
39+
of data, the Amazon S3 destination is recommended.
3240

3341
retriever:
3442
type: SimpleRetriever
@@ -65,6 +73,33 @@ definitions:
6573
path: "/2/annotations"
6674
data_field: "data"
6775

76+
schema_loader:
77+
type: InlineSchemaLoader
78+
schema:
79+
$schema: https://json-schema.org/draft-07/schema#
80+
type: object
81+
properties:
82+
date:
83+
description: The date when the annotation was made
84+
type:
85+
- "null"
86+
- string
87+
format: date
88+
details:
89+
description: Additional details or information related to the annotation
90+
type:
91+
- "null"
92+
- string
93+
id:
94+
description: The unique identifier for the annotation
95+
type:
96+
- "null"
97+
- integer
98+
label:
99+
description: The label assigned to the annotation
100+
type:
101+
- "null"
102+
- string
68103
cohorts_stream:
69104
$ref: "#/definitions/base_stream"
70105
$parameters:
@@ -73,6 +108,150 @@ definitions:
73108
path: "/3/cohorts"
74109
data_field: "cohorts"
75110

111+
schema_loader:
112+
type: InlineSchemaLoader
113+
schema:
114+
$schema: https://json-schema.org/draft-07/schema#
115+
type: object
116+
properties:
117+
appId:
118+
description: The unique identifier of the application.
119+
type:
120+
- "null"
121+
- integer
122+
archived:
123+
description: Indicates if the cohort data is archived or not.
124+
type:
125+
- "null"
126+
- boolean
127+
definition:
128+
description: The specific definition or criteria for the cohort.
129+
type:
130+
- "null"
131+
- object
132+
description:
133+
description: A brief explanation or summary of the cohort data.
134+
type:
135+
- "null"
136+
- string
137+
finished:
138+
description: Indicates if the cohort data has been finalized.
139+
type:
140+
- "null"
141+
- boolean
142+
id:
143+
description: The unique identifier for the cohort.
144+
type:
145+
- "null"
146+
- string
147+
name:
148+
description: The name or title of the cohort.
149+
type:
150+
- "null"
151+
- string
152+
owners:
153+
description: The owners or administrators of the cohort.
154+
type:
155+
- "null"
156+
- array
157+
items:
158+
type: string
159+
published:
160+
description: Status indicating if the cohort data is published or not.
161+
type:
162+
- "null"
163+
- boolean
164+
size:
165+
description: Size or scale of the cohort data.
166+
type:
167+
- "null"
168+
- integer
169+
type:
170+
description: The type or category of the cohort.
171+
type:
172+
- "null"
173+
- string
174+
lastMod:
175+
description: Timestamp of the last modification made to the cohort.
176+
type:
177+
- "null"
178+
- integer
179+
lastComputed:
180+
description: Timestamp of the last computation of cohort data.
181+
type:
182+
- "null"
183+
- integer
184+
hidden:
185+
description: Flag to determine if the cohort is hidden from view.
186+
type:
187+
- "null"
188+
- boolean
189+
is_predictive:
190+
description: Flag to indicate if the cohort is predictive in nature.
191+
type:
192+
- "null"
193+
- boolean
194+
is_official_content:
195+
description: Indicates if the cohort data is official content.
196+
type:
197+
- "null"
198+
- boolean
199+
chart_id:
200+
description: The identifier of the chart associated with the cohort.
201+
type:
202+
- "null"
203+
- string
204+
createdAt:
205+
description: The timestamp when the cohort was created.
206+
type:
207+
- "null"
208+
- integer
209+
edit_id:
210+
description: The ID for editing purposes or version control.
211+
type:
212+
- "null"
213+
- string
214+
last_viewed:
215+
description: Timestamp when the cohort was last viewed.
216+
type:
217+
- "null"
218+
- integer
219+
location_id:
220+
description: Identifier of the location associated with the cohort.
221+
type:
222+
- "null"
223+
- string
224+
metadata:
225+
description: Additional information or data related to the cohort.
226+
type:
227+
- "null"
228+
- array
229+
items:
230+
type: string
231+
popularity:
232+
description: Popularity rank or score of the cohort.
233+
type:
234+
- "null"
235+
- integer
236+
shortcut_ids:
237+
description: Identifiers of any shortcuts associated with the cohort.
238+
type:
239+
- "null"
240+
- array
241+
items:
242+
type: string
243+
view_count:
244+
description: The total count of views on the cohort data.
245+
type:
246+
- "null"
247+
- integer
248+
viewers:
249+
description: Users or viewers who have access to the cohort data.
250+
type:
251+
- "null"
252+
- array
253+
items:
254+
type: string
76255
base_incremental_stream:
77256
retriever:
78257
$ref: "#/definitions/retriever"
@@ -99,6 +278,23 @@ definitions:
99278
path: "/2/sessions/average"
100279
stream_cursor_field: "date"
101280

281+
schema_loader:
282+
type: InlineSchemaLoader
283+
schema:
284+
$schema: https://json-schema.org/draft-07/schema#
285+
type: object
286+
properties:
287+
date:
288+
description: The date on which the session occurred
289+
type:
290+
- "null"
291+
- string
292+
format: date-time
293+
length:
294+
description: The duration of the session in seconds
295+
type:
296+
- "null"
297+
- number
102298
active_users_stream:
103299
$ref: "#/definitions/base_incremental_stream"
104300
retriever:
@@ -125,6 +321,25 @@ definitions:
125321
primary_key: "date"
126322
path: "/2/users"
127323

324+
schema_loader:
325+
type: InlineSchemaLoader
326+
schema:
327+
$schema: https://json-schema.org/draft-07/schema#
328+
type: object
329+
properties:
330+
date:
331+
description: The date for which the active user data is reported
332+
type:
333+
- "null"
334+
- string
335+
format: date
336+
statistics:
337+
description:
338+
The statistics related to the active users for the given
339+
date
340+
type:
341+
- "null"
342+
- object
128343
streams:
129344
- "#/definitions/annotations_stream"
130345
- "#/definitions/cohorts_stream"

airbyte-integrations/connectors/source-amplitude/source_amplitude/schemas/active_users.json

-13
This file was deleted.

0 commit comments

Comments
 (0)