Skip to content

Commit

Permalink
source-amplitude: ensure inline schemas, updated cdk, poetry (where p…
Browse files Browse the repository at this point in the history
…ossible) (#36631)

Co-authored-by: Serhii Lazebnyi <53845333+lazebnyi@users.noreply.github.com>
  • Loading branch information
bleonard and lazebnyi authored May 7, 2024
1 parent f9b576e commit 59adbe8
Show file tree
Hide file tree
Showing 10 changed files with 299 additions and 166 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: fa9f58c6-2d03-4237-aaa4-07d75e0c1396
dockerImageTag: 0.3.8
dockerImageTag: 0.3.10
dockerRepository: airbyte/source-amplitude
documentationUrl: https://docs.airbyte.com/integrations/sources/amplitude
githubIssueLabel: source-amplitude
Expand Down
35 changes: 17 additions & 18 deletions airbyte-integrations/connectors/source-amplitude/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "0.3.8"
version = "0.3.10"
name = "source-amplitude"
description = "Source implementation for Amplitude."
authors = [ "Airbyte <contact@airbyte.io>",]
Expand All @@ -17,7 +17,7 @@ include = "source_amplitude"

[tool.poetry.dependencies]
python = "^3.9,<3.12"
airbyte-cdk = "^0"
airbyte-cdk = "0.80.0"

[tool.poetry.scripts]
source-amplitude = "source_amplitude.run:run"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ definitions:
field_path: ["{{ parameters.get('data_field') }}"]
requester:
type: HttpRequester
url_base: "https://{{'analytics.eu.' if config['data_region'] == 'EU Residency Server' else '' }}amplitude.com/api"
url_base:
"https://{{'analytics.eu.' if config['data_region'] == 'EU Residency
Server' else '' }}amplitude.com/api"
http_method: "GET"
authenticator:
type: BasicHttpAuthenticator
Expand All @@ -19,16 +21,22 @@ definitions:
response_filters:
- http_codes: [400]
action: FAIL
error_message: The file size of the exported data is too large. Shorten the time ranges and try again. The limit size is 4GB.
error_message:
The file size of the exported data is too large. Shorten the
time ranges and try again. The limit size is 4GB.
- http_codes: [403]
action: FAIL
error_message: Access denied due to lack of permission or invalid API/Secret key or wrong data region.
error_message:
Access denied due to lack of permission or invalid API/Secret
key or wrong data region.
- http_codes: [404]
action: IGNORE
error_message: No data collected
- http_codes: [504]
action: FAIL
error_message: The amount of data is large causing a timeout. For large amounts of data, the Amazon S3 destination is recommended.
error_message:
The amount of data is large causing a timeout. For large amounts
of data, the Amazon S3 destination is recommended.

retriever:
type: SimpleRetriever
Expand Down Expand Up @@ -65,6 +73,33 @@ definitions:
path: "/2/annotations"
data_field: "data"

schema_loader:
type: InlineSchemaLoader
schema:
$schema: https://json-schema.org/draft-07/schema#
type: object
properties:
date:
description: The date when the annotation was made
type:
- "null"
- string
format: date
details:
description: Additional details or information related to the annotation
type:
- "null"
- string
id:
description: The unique identifier for the annotation
type:
- "null"
- integer
label:
description: The label assigned to the annotation
type:
- "null"
- string
cohorts_stream:
$ref: "#/definitions/base_stream"
$parameters:
Expand All @@ -73,6 +108,150 @@ definitions:
path: "/3/cohorts"
data_field: "cohorts"

schema_loader:
type: InlineSchemaLoader
schema:
$schema: https://json-schema.org/draft-07/schema#
type: object
properties:
appId:
description: The unique identifier of the application.
type:
- "null"
- integer
archived:
description: Indicates if the cohort data is archived or not.
type:
- "null"
- boolean
definition:
description: The specific definition or criteria for the cohort.
type:
- "null"
- object
description:
description: A brief explanation or summary of the cohort data.
type:
- "null"
- string
finished:
description: Indicates if the cohort data has been finalized.
type:
- "null"
- boolean
id:
description: The unique identifier for the cohort.
type:
- "null"
- string
name:
description: The name or title of the cohort.
type:
- "null"
- string
owners:
description: The owners or administrators of the cohort.
type:
- "null"
- array
items:
type: string
published:
description: Status indicating if the cohort data is published or not.
type:
- "null"
- boolean
size:
description: Size or scale of the cohort data.
type:
- "null"
- integer
type:
description: The type or category of the cohort.
type:
- "null"
- string
lastMod:
description: Timestamp of the last modification made to the cohort.
type:
- "null"
- integer
lastComputed:
description: Timestamp of the last computation of cohort data.
type:
- "null"
- integer
hidden:
description: Flag to determine if the cohort is hidden from view.
type:
- "null"
- boolean
is_predictive:
description: Flag to indicate if the cohort is predictive in nature.
type:
- "null"
- boolean
is_official_content:
description: Indicates if the cohort data is official content.
type:
- "null"
- boolean
chart_id:
description: The identifier of the chart associated with the cohort.
type:
- "null"
- string
createdAt:
description: The timestamp when the cohort was created.
type:
- "null"
- integer
edit_id:
description: The ID for editing purposes or version control.
type:
- "null"
- string
last_viewed:
description: Timestamp when the cohort was last viewed.
type:
- "null"
- integer
location_id:
description: Identifier of the location associated with the cohort.
type:
- "null"
- string
metadata:
description: Additional information or data related to the cohort.
type:
- "null"
- array
items:
type: string
popularity:
description: Popularity rank or score of the cohort.
type:
- "null"
- integer
shortcut_ids:
description: Identifiers of any shortcuts associated with the cohort.
type:
- "null"
- array
items:
type: string
view_count:
description: The total count of views on the cohort data.
type:
- "null"
- integer
viewers:
description: Users or viewers who have access to the cohort data.
type:
- "null"
- array
items:
type: string
base_incremental_stream:
retriever:
$ref: "#/definitions/retriever"
Expand All @@ -99,6 +278,23 @@ definitions:
path: "/2/sessions/average"
stream_cursor_field: "date"

schema_loader:
type: InlineSchemaLoader
schema:
$schema: https://json-schema.org/draft-07/schema#
type: object
properties:
date:
description: The date on which the session occurred
type:
- "null"
- string
format: date-time
length:
description: The duration of the session in seconds
type:
- "null"
- number
active_users_stream:
$ref: "#/definitions/base_incremental_stream"
retriever:
Expand All @@ -125,6 +321,25 @@ definitions:
primary_key: "date"
path: "/2/users"

schema_loader:
type: InlineSchemaLoader
schema:
$schema: https://json-schema.org/draft-07/schema#
type: object
properties:
date:
description: The date for which the active user data is reported
type:
- "null"
- string
format: date
statistics:
description:
The statistics related to the active users for the given
date
type:
- "null"
- object
streams:
- "#/definitions/annotations_stream"
- "#/definitions/cohorts_stream"
Expand Down

This file was deleted.

Loading

0 comments on commit 59adbe8

Please sign in to comment.