Skip to content

Commit

Permalink
Source Recharge: use default availability strategy (#22473)
Browse files Browse the repository at this point in the history
* Source Recharge: use default availability strategy

* Remove invalid_config from full_refresh tests

* Update changelog

* Remove error handling that is covered by HttpAvailabilityStrategy

* Keep should_retry, change error handling

---------

Co-authored-by: Serhii Lazebnyi <53845333+lazebnyi@users.noreply.github.com>
  • Loading branch information
arsenlosenko and lazebnyi authored Feb 8, 2023
1 parent c2ee081 commit a6990bc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,9 @@
icon: recharge.svg
sourceType: api
releaseStage: generally_available
allowedHosts:
hosts:
- api.rechargeapps.com
- name: Recreation
sourceDefinitionId: 25d7535d-91e0-466a-aa7f-af81578be277
dockerRepository: airbyte/source-recreation
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-recharge/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ RUN pip install .
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.2.5
LABEL io.airbyte.version=0.2.6
LABEL io.airbyte.name=airbyte/source-recharge
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import pendulum
import requests
from airbyte_cdk.sources.streams.availability_strategy import AvailabilityStrategy
from airbyte_cdk.sources.streams.http import HttpStream
from airbyte_cdk.sources.utils.transform import TransformConfig, TypeTransformer

Expand All @@ -29,10 +28,6 @@ class RechargeStream(HttpStream, ABC):
def data_path(self):
return self.name

@property
def availability_strategy(self) -> Optional["AvailabilityStrategy"]:
return None

def path(
self, stream_state: Mapping[str, Any] = None, stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None
) -> str:
Expand Down Expand Up @@ -72,10 +67,6 @@ def should_retry(self, response: requests.Response) -> bool:

if incomplete_data_response:
return True
elif response.status_code == requests.codes.FORBIDDEN:
setattr(self, "raise_on_http_errors", False)
self.logger.error(f"Skiping stream {self.name} because of a 403 error.")
return False

return super().should_retry(response)

Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/recharge.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ The Recharge connector should gracefully handle Recharge API limitations under n

| Version | Date | Pull Request | Subject |
|:--------| :--------- | :------------------------------------------------------- | :---------------------------------------------------------------------------------------- |
| 0.2.6 | 2023-02-07 | [22473](https://github.com/airbytehq/airbyte/pull/22473) | Use default availability strategy
| 0.2.5 | 2023-01-27 | [22021](https://github.com/airbytehq/airbyte/pull/22021) | Set `AvailabilityStrategy` for streams explicitly to `None` |
| 0.2.4 | 2022-10-11 | [17822](https://github.com/airbytehq/airbyte/pull/17822) | Do not parse JSON in `should_retry` |
| 0.2.3 | 2022-10-11 | [17822](https://github.com/airbytehq/airbyte/pull/17822) | Do not parse JSON in `should_retry` |
Expand Down

0 comments on commit a6990bc

Please sign in to comment.