Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source: Google Analytics 4 (GA4) - improve config validation and SAT #20889

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a7d986d
bump 0.0.4
grubberr Dec 27, 2022
ce2bc0d
remove ChainMap
grubberr Dec 27, 2022
1146128
_validate_and_transform added
grubberr Dec 27, 2022
19e5b5a
custom_reports_schema.json added
grubberr Dec 27, 2022
1da5688
"required": ["name", "dimensions", "metrics"] - added
grubberr Dec 28, 2022
378075d
source.py improved
grubberr Dec 28, 2022
70a92fa
Merge branch 'master' into grubberr/source-google-analytics-data-api-…
grubberr Dec 29, 2022
b844d3a
validate "credentials.credentials_json"
grubberr Dec 29, 2022
7eaaee8
Merge branch 'master' into grubberr/source-google-analytics-data-api-…
grubberr Dec 30, 2022
bfbbcd4
test_check_connection -> test_check
grubberr Dec 30, 2022
0801207
validate "Start Date"
grubberr Dec 30, 2022
148da90
acceptance-test-config.yml new format
grubberr Jan 2, 2023
82f4183
Merge branch 'master' into grubberr/source-google-analytics-data-api-…
grubberr Jan 2, 2023
888e519
re-implement incremental
grubberr Jan 2, 2023
3431a62
add incremental to SAT
grubberr Jan 2, 2023
ae7280d
Merge branch 'master' into grubberr/source-google-analytics-data-api-…
grubberr Jan 3, 2023
3155012
instance.saved_authenticator added
grubberr Jan 3, 2023
ebe423a
Merge branch 'master' into grubberr/source-google-analytics-data-api-…
grubberr Jan 4, 2023
f623891
convert old datetime state format
grubberr Jan 4, 2023
9ed7ddf
google-analytics-v4.md updated
grubberr Jan 4, 2023
fef377f
fixes for Bazarnov review
grubberr Jan 4, 2023
c3715a9
Merge branch 'master' into grubberr/source-google-analytics-data-api-…
grubberr Jan 5, 2023
b49e4bc
fix comment
grubberr Jan 5, 2023
55fdaea
DATE_FORMAT fixes
grubberr Jan 5, 2023
1e7f413
Merge branch 'master' into grubberr/source-google-analytics-data-api-…
grubberr Jan 6, 2023
3a68b27
GoogleAnalyticsDataApiTestConnectionStream -> GoogleAnalyticsDataApiM…
grubberr Jan 6, 2023
7bd9fcf
improve validation window_in_days
grubberr Jan 6, 2023
c30b863
read_records removed
grubberr Jan 6, 2023
73aa6c7
both dimensions and metrics are required
grubberr Jan 6, 2023
3a5db20
Merge branch 'master' into grubberr/source-google-analytics-data-api-…
grubberr Jan 7, 2023
4c48e81
remove GoogleAnalyticsDataApiGenericStream class, keep only GoogleAna…
grubberr Jan 7, 2023
65cdf3a
"date" dimension is mandatory
grubberr Jan 7, 2023
402a123
check that custom dimensions and metrics are valid
grubberr Jan 8, 2023
6228510
bump 0.1.0
grubberr Jan 8, 2023
55e5c1c
should_retry 429 changed
grubberr Jan 8, 2023
0caca7f
added doc string
grubberr Jan 9, 2023
f87f5e2
self._stop_iteration added
grubberr Jan 9, 2023
931e364
failed to get metadata, over quota, try later
grubberr Jan 9, 2023
1168bb6
auto-bump connector version
octavia-squidington-iii Jan 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@
- name: Google Analytics 4 (GA4)
sourceDefinitionId: 3cc2eafd-84aa-4dca-93af-322d9dfeec1a
dockerRepository: airbyte/source-google-analytics-data-api
dockerImageTag: 0.0.3
dockerImageTag: 0.1.0
documentationUrl: https://docs.airbyte.com/integrations/sources/google-analytics-v4
icon: google-analytics.svg
sourceType: api
Expand Down
14 changes: 9 additions & 5 deletions airbyte-config/init/src/main/resources/seed/source_specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5397,7 +5397,7 @@
oauthFlowOutputParameters:
- - "access_token"
- - "refresh_token"
- dockerImage: "airbyte/source-google-analytics-data-api:0.0.3"
- dockerImage: "airbyte/source-google-analytics-data-api:0.1.0"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/google-analytics-v4"
connectionSpecification:
Expand Down Expand Up @@ -5476,9 +5476,11 @@
airbyte_secret: true
date_ranges_start_date:
type: "string"
title: "Date Range Start Date"
description: "The start date. One of the values Ndaysago, yesterday, today\
\ or in the format YYYY-MM-DD"
title: "Start Date"
description: "The start date from which to replicate report data in the\
\ format YYYY-MM-DD. Data generated before this date will not be included\
\ in the report."
format: "date"
order: 2
custom_reports:
order: 3
Expand All @@ -5499,14 +5501,16 @@
\ causing inaccuracies in the returned results. We recommend setting this\
\ to 1 unless you have a hard requirement to make the sync faster at the\
\ expense of accuracy. The minimum allowed value for this field is 1,\
\ and the maximum is 364. "
\ and the maximum is 364."
examples:
- 30
- 60
- 90
- 120
- 200
- 364
minimum: 1
maximum: 364
default: 1
order: 4
supportsNormalization: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ COPY source_google_analytics_data_api ./source_google_analytics_data_api
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.0.3
LABEL io.airbyte.version=0.1.0
LABEL io.airbyte.name=airbyte/source-google-analytics-data-api
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
# See [Source Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/source-acceptance-tests-reference)
# for more information about how to configure these tests
connector_image: airbyte/source-google-analytics-data-api:dev
tests:
acceptance_tests:
spec:
- spec_path: "source_google_analytics_data_api/spec.json"
tests:
- spec_path: "source_google_analytics_data_api/spec.json"
backward_compatibility_tests_config:
disable_for_version: "0.0.3"
connection:
- config_path: "secrets/config.json"
status: "succeed"
- config_path: "integration_tests/invalid_config.json"
status: "failed"
tests:
- config_path: "secrets/config.json"
status: "succeed"
- config_path: "integration_tests/invalid_config.json"
status: "failed"
discovery:
- config_path: "secrets/config.json"
backward_compatibility_tests_config:
disable_for_version: "0.0.2"
tests:
- config_path: "secrets/config.json"
backward_compatibility_tests_config:
disable_for_version: "0.0.2"
basic_read:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
empty_streams: []
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
full_refresh:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
ignored_fields:
"daily_active_users": ["uuid"]
"weekly_active_users": ["uuid"]
"four_weekly_active_users": ["uuid"]
"devices": ["uuid"]
"locations": ["uuid"]
"pages": ["uuid"]
"traffic_sources": ["uuid"]
"website_overview": ["uuid"]
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
ignored_fields:
"daily_active_users": ["uuid"]
"weekly_active_users": ["uuid"]
"four_weekly_active_users": ["uuid"]
"devices": ["uuid"]
"locations": ["uuid"]
"pages": ["uuid"]
"traffic_sources": ["uuid"]
"website_overview": ["uuid"]
incremental:
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
future_state:
future_state_path: "integration_tests/abnormal_state.json"
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "daily_active_users"
},
"stream_state": {
"date": "20990101"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "weekly_active_users"
},
"stream_state": {
"date": "20990101"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "four_weekly_active_users"
},
"stream_state": {
"date": "20990101"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "devices"
},
"stream_state": {
"date": "20990101"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "locations"
},
"stream_state": {
"date": "20990101"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "pages"
},
"stream_state": {
"date": "20990101"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "traffic_sources"
},
"stream_state": {
"date": "20990101"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "website_overview"
},
"stream_state": {
"date": "20990101"
}
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"stream": {
"name": "daily_active_users",
"json_schema": {},
"supported_sync_modes": ["incremental"],
"source_defined_cursor": false,
"default_cursor_field": ["date"]
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["date"],
"source_defined_primary_key": [["uuid"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "overwrite"
Expand All @@ -15,9 +16,10 @@
"stream": {
"name": "weekly_active_users",
"json_schema": {},
"supported_sync_modes": ["incremental"],
"source_defined_cursor": false,
"default_cursor_field": ["date"]
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["date"],
"source_defined_primary_key": [["uuid"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "overwrite"
Expand All @@ -26,9 +28,10 @@
"stream": {
"name": "four_weekly_active_users",
"json_schema": {},
"supported_sync_modes": ["incremental"],
"source_defined_cursor": false,
"default_cursor_field": ["date"]
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["date"],
"source_defined_primary_key": [["uuid"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "overwrite"
Expand All @@ -37,9 +40,10 @@
"stream": {
"name": "devices",
"json_schema": {},
"supported_sync_modes": ["incremental"],
"source_defined_cursor": false,
"default_cursor_field": ["date"]
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["date"],
"source_defined_primary_key": [["uuid"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "overwrite"
Expand All @@ -48,9 +52,10 @@
"stream": {
"name": "locations",
"json_schema": {},
"supported_sync_modes": ["incremental"],
"source_defined_cursor": false,
"default_cursor_field": ["date"]
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["date"],
"source_defined_primary_key": [["uuid"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "overwrite"
Expand All @@ -59,9 +64,10 @@
"stream": {
"name": "pages",
"json_schema": {},
"supported_sync_modes": ["incremental"],
"source_defined_cursor": false,
"default_cursor_field": ["date"]
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["date"],
"source_defined_primary_key": [["uuid"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "overwrite"
Expand All @@ -70,9 +76,10 @@
"stream": {
"name": "traffic_sources",
"json_schema": {},
"supported_sync_modes": ["incremental"],
"source_defined_cursor": false,
"default_cursor_field": ["date"]
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["date"],
"source_defined_primary_key": [["uuid"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "overwrite"
Expand All @@ -81,9 +88,10 @@
"stream": {
"name": "website_overview",
"json_schema": {},
"supported_sync_modes": ["incremental"],
"source_defined_cursor": false,
"default_cursor_field": ["date"]
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["date"],
"source_defined_primary_key": [["uuid"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "overwrite"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"type": "array",
"items": {
"type": "object",
"required": ["name", "dimensions", "metrics"],
"properties": {
"name": {
"type": "string"
},
"dimensions": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
},
"metrics": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
}
}
}
}
Loading