Skip to content

Commit

Permalink
Source Mixpanel: ConnectionResetError fix (#25543)
Browse files Browse the repository at this point in the history
* added HttpAvailabilityStrategy and undeclared fields for annotations and export streams

* added extra fields to export stream, updated expected records

* added exponential backoff

* changed testing range days to 10

* updated expected records, added typeTransformer to exports stream

* added changelog

* removed HttpAvailabilityStrategy property

* added null in type for annotations schema

* removed unused imports in base.py

* added retry for sream export when ConnectionResetError occurs

* added changelog

* fixed version in changelog

* bump version in metadata.md

* auto-bump connector version

---------

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
  • Loading branch information
darynaishchenko and octavia-squidington-iii committed May 4, 2023
1 parent 2da66e9 commit b973bc8
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18111,7 +18111,7 @@
"sourceDefinitionId": "12928b32-bf0a-4f1e-964f-07e12e37153a",
"name": "Mixpanel",
"dockerRepository": "airbyte/source-mixpanel",
"dockerImageTag": "0.1.32",
"dockerImageTag": "0.1.33",
"documentationUrl": "https://docs.airbyte.com/integrations/sources/mixpanel",
"icon": "mixpanel.svg",
"sourceType": "api",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@
- name: Mixpanel
sourceDefinitionId: 12928b32-bf0a-4f1e-964f-07e12e37153a
dockerRepository: airbyte/source-mixpanel
dockerImageTag: 0.1.32
dockerImageTag: 0.1.33
documentationUrl: https://docs.airbyte.com/integrations/sources/mixpanel
icon: mixpanel.svg
sourceType: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9209,7 +9209,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-mixpanel:0.1.32"
- dockerImage: "airbyte/source-mixpanel:0.1.33"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/mixpanel"
connectionSpecification:
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-mixpanel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]


LABEL io.airbyte.version=0.1.32
LABEL io.airbyte.version=0.1.33
LABEL io.airbyte.name=airbyte/source-mixpanel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: 12928b32-bf0a-4f1e-964f-07e12e37153a
dockerImageTag: 0.1.32
dockerImageTag: 0.1.33
dockerRepository: airbyte/source-mixpanel
githubIssueLabel: source-mixpanel
icon: mixpanel.svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ def url_base(self):
def path(self, **kwargs) -> str:
return "export"

def should_retry(self, response: requests.Response) -> bool:
try:
# trying to parse response to avoid ConnectionResetError and retry if it occurs
self.iter_dicts(response.iter_lines(decode_unicode=True))
except ConnectionResetError:
return True
return super().should_retry(response)

def iter_dicts(self, lines):
"""
The incoming stream has to be JSON lines format.
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/mixpanel.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Syncing huge date windows may take longer due to Mixpanel's low API rate-limits

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:------------------------------------------------------------------------------------------------------------|
| 0.1.33 | 2023-04-25 | [25543](https://github.com/airbytehq/airbyte/pull/25543) | Set should_retry for 104 error in stream export |
| 0.1.32 | 2023-04-11 | [25056](https://github.com/airbytehq/airbyte/pull/25056) | Set HttpAvailabilityStrategy, add exponential backoff, streams export and annotations add undeclared fields |
| 0.1.31 | 2023-02-13 | [22936](https://github.com/airbytehq/airbyte/pull/22936) | Specified date formatting in specification |
| 0.1.30 | 2023-01-27 | [22017](https://github.com/airbytehq/airbyte/pull/22017) | Set `AvailabilityStrategy` for streams explicitly to `None` |
Expand Down

0 comments on commit b973bc8

Please sign in to comment.