Skip to content

Commit

Permalink
🐛 [source-google-analytics-data-api] fix issue if metrics or dimensio…
Browse files Browse the repository at this point in the history
…ns api response does not have name field (#30506)
  • Loading branch information
brianjlai authored Sep 17, 2023
1 parent de0a392 commit 90375ee
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
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=1.4.0
LABEL io.airbyte.version=1.4.1
LABEL io.airbyte.name=airbyte/source-google-analytics-data-api
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: 3cc2eafd-84aa-4dca-93af-322d9dfeec1a
dockerImageTag: 1.4.0
dockerImageTag: 1.4.1
dockerRepository: airbyte/source-google-analytics-data-api
githubIssueLabel: source-google-analytics-data-api
icon: google-analytics.svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ def parse_response(
) -> Iterable[Mapping]:
r = response.json()

dimensions = [h.get("name").replace(":", "_") for h in r.get("dimensionHeaders", [{}])]
metrics = [h.get("name").replace(":", "_") for h in r.get("metricHeaders", [{}])]
metrics_type_map = {h.get("name").replace(":", "_"): h.get("type") for h in r.get("metricHeaders", [{}])}
dimensions = [h.get("name").replace(":", "_") if "name" in h else None for h in r.get("dimensionHeaders", [{}])]
metrics = [h.get("name").replace(":", "_") if "name" in h else None for h in r.get("metricHeaders", [{}])]
metrics_type_map = {h.get("name").replace(":", "_"): h.get("type") for h in r.get("metricHeaders", [{}]) if "name" in h}

for row in r.get("rows", []):
record = {
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/google-analytics-data-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ The Google Analytics connector is subject to Google Analytics Data API quotas. P

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:--------------------------------------------------------------------------------|
| 1.4.1 | 2023-09-17 | [30506](https://github.com/airbytehq/airbyte/pull/30506) | Fix None type error when metrics or dimensions response does not have name |
| 1.4.0 | 2023-09-15 | [30417](https://github.com/airbytehq/airbyte/pull/30417) | Change start date to optional; add suggested streams and update errors handling |
| 1.3.1 | 2023-09-14 | [30424](https://github.com/airbytehq/airbyte/pull/30424) | Fixed duplicated stream issue |
| 1.2.0 | 2023-09-11 | [30290](https://github.com/airbytehq/airbyte/pull/30290) | Add new preconfigured reports |
Expand Down

0 comments on commit 90375ee

Please sign in to comment.