From 0d3b2d88f1e32516cb964597885737ff43ffd1b6 Mon Sep 17 00:00:00 2001 From: Daryna Ishchenko Date: Wed, 30 Aug 2023 16:26:24 +0300 Subject: [PATCH 1/4] added old api version for orders stream --- airbyte-integrations/connectors/source-recharge/Dockerfile | 2 +- .../connectors/source-recharge/metadata.yaml | 2 +- .../connectors/source-recharge/source_recharge/api.py | 6 ++++++ docs/integrations/sources/recharge.md | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/airbyte-integrations/connectors/source-recharge/Dockerfile b/airbyte-integrations/connectors/source-recharge/Dockerfile index bbc8964f4f60c..460d9a3062981 100644 --- a/airbyte-integrations/connectors/source-recharge/Dockerfile +++ b/airbyte-integrations/connectors/source-recharge/Dockerfile @@ -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=1.0.0 +LABEL io.airbyte.version=1.0.1 LABEL io.airbyte.name=airbyte/source-recharge diff --git a/airbyte-integrations/connectors/source-recharge/metadata.yaml b/airbyte-integrations/connectors/source-recharge/metadata.yaml index b4a498ec5a26d..121d4f086f3c6 100644 --- a/airbyte-integrations/connectors/source-recharge/metadata.yaml +++ b/airbyte-integrations/connectors/source-recharge/metadata.yaml @@ -5,7 +5,7 @@ data: connectorSubtype: api connectorType: source definitionId: 45d2e135-2ede-49e1-939f-3e3ec357a65e - dockerImageTag: 1.0.0 + dockerImageTag: 1.0.1 dockerRepository: airbyte/source-recharge githubIssueLabel: source-recharge icon: recharge.svg diff --git a/airbyte-integrations/connectors/source-recharge/source_recharge/api.py b/airbyte-integrations/connectors/source-recharge/source_recharge/api.py index c2c9d3e85f8c2..599d22e9e859e 100644 --- a/airbyte-integrations/connectors/source-recharge/source_recharge/api.py +++ b/airbyte-integrations/connectors/source-recharge/source_recharge/api.py @@ -174,8 +174,14 @@ class Onetimes(IncrementalRechargeStream): class Orders(IncrementalRechargeStream): """ Orders Stream: https://developer.rechargepayments.com/v1-shopify?python#list-orders + Using old API version to avoid schema changes and loosing email, first_name, last_name columns, because in new version it not present """ + def request_headers( + self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None + ) -> Mapping[str, Any]: + return {"x-recharge-version": OLD_API_VERSION} + class Products(RechargeStream): """ diff --git a/docs/integrations/sources/recharge.md b/docs/integrations/sources/recharge.md index ce15a8559e2ad..40f368ee89c30 100644 --- a/docs/integrations/sources/recharge.md +++ b/docs/integrations/sources/recharge.md @@ -76,6 +76,7 @@ The Recharge connector should gracefully handle Recharge API limitations under n | Version | Date | Pull Request | Subject | |:--------|:-----------|:---------------------------------------------------------|:------------------------------------------------------------------------------------------| +| 1.0.1 | 2023-08-30 | | Revert for orders stream to use old API version 2021-01 | | 1.0.0 | 2023-06-22 | [27612](https://github.com/airbytehq/airbyte/pull/27612) | Change data type of the `shopify_variant_id_not_found` field of the `Charges` stream | | 0.2.10 | 2023-06-20 | [27503](https://github.com/airbytehq/airbyte/pull/27503) | Update API version to 2021-11 | | 0.2.9 | 2023-04-10 | [25009](https://github.com/airbytehq/airbyte/pull/25009) | Fix owner slicing for `Metafields` stream | From caaa472aa626f3f807a46b6a8ec0d052ad219d7c Mon Sep 17 00:00:00 2001 From: Daryna Ishchenko Date: Wed, 30 Aug 2023 16:37:45 +0300 Subject: [PATCH 2/4] updated changelog --- docs/integrations/sources/recharge.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrations/sources/recharge.md b/docs/integrations/sources/recharge.md index 40f368ee89c30..35b5a57d6c51e 100644 --- a/docs/integrations/sources/recharge.md +++ b/docs/integrations/sources/recharge.md @@ -76,7 +76,7 @@ The Recharge connector should gracefully handle Recharge API limitations under n | Version | Date | Pull Request | Subject | |:--------|:-----------|:---------------------------------------------------------|:------------------------------------------------------------------------------------------| -| 1.0.1 | 2023-08-30 | | Revert for orders stream to use old API version 2021-01 | +| 1.0.1 | 2023-08-30 | [29992](https://github.com/airbytehq/airbyte/pull/29992) | Revert for orders stream to use old API version 2021-01 | | 1.0.0 | 2023-06-22 | [27612](https://github.com/airbytehq/airbyte/pull/27612) | Change data type of the `shopify_variant_id_not_found` field of the `Charges` stream | | 0.2.10 | 2023-06-20 | [27503](https://github.com/airbytehq/airbyte/pull/27503) | Update API version to 2021-11 | | 0.2.9 | 2023-04-10 | [25009](https://github.com/airbytehq/airbyte/pull/25009) | Fix owner slicing for `Metafields` stream | From 1be6c47c2b9d56d02137e4db3756aa80147b4c39 Mon Sep 17 00:00:00 2001 From: Daryna Ishchenko Date: Mon, 4 Sep 2023 16:32:09 +0300 Subject: [PATCH 3/4] updated api version names --- .../source-recharge/source_recharge/api.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/airbyte-integrations/connectors/source-recharge/source_recharge/api.py b/airbyte-integrations/connectors/source-recharge/source_recharge/api.py index 599d22e9e859e..fd21d51b218c7 100644 --- a/airbyte-integrations/connectors/source-recharge/source_recharge/api.py +++ b/airbyte-integrations/connectors/source-recharge/source_recharge/api.py @@ -11,8 +11,8 @@ from airbyte_cdk.sources.streams.http import HttpStream from airbyte_cdk.sources.utils.transform import TransformConfig, TypeTransformer -API_VERSION = "2021-11" -OLD_API_VERSION = "2021-01" +API_VERSION_2021_11 = "2021-11" +API_VERSION_2021_01 = "2021-01" class RechargeStream(HttpStream, ABC): @@ -38,7 +38,7 @@ def data_path(self): def request_headers( self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None ) -> Mapping[str, Any]: - return {"x-recharge-version": API_VERSION} + return {"x-recharge-version": API_VERSION_2021_11} def path( self, stream_state: Mapping[str, Any] = None, stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None @@ -180,7 +180,7 @@ class Orders(IncrementalRechargeStream): def request_headers( self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None ) -> Mapping[str, Any]: - return {"x-recharge-version": OLD_API_VERSION} + return {"x-recharge-version": API_VERSION_2021_01} class Products(RechargeStream): @@ -192,7 +192,7 @@ class Products(RechargeStream): def request_headers( self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None ) -> Mapping[str, Any]: - return {"x-recharge-version": OLD_API_VERSION} + return {"x-recharge-version": API_VERSION_2021_01} class Shop(RechargeStream): @@ -207,7 +207,7 @@ class Shop(RechargeStream): def request_headers( self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None ) -> Mapping[str, Any]: - return {"x-recharge-version": OLD_API_VERSION} + return {"x-recharge-version": API_VERSION_2021_01} class Subscriptions(IncrementalRechargeStream): From 16895f2aa433ad312d517108cdaae8fe1f48a70a Mon Sep 17 00:00:00 2001 From: darynaishchenko Date: Tue, 5 Sep 2023 08:59:43 +0000 Subject: [PATCH 4/4] Automated Commit - Formatting Changes --- .../source_hubplanner/schemas/projects.json | 6 +++--- .../source_hubplanner/schemas/resources.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/airbyte-integrations/connectors/source-hubplanner/source_hubplanner/schemas/projects.json b/airbyte-integrations/connectors/source-hubplanner/source_hubplanner/schemas/projects.json index 5b40142bed5eb..24e456bf861af 100644 --- a/airbyte-integrations/connectors/source-hubplanner/source_hubplanner/schemas/projects.json +++ b/airbyte-integrations/connectors/source-hubplanner/source_hubplanner/schemas/projects.json @@ -166,19 +166,19 @@ "categoryGroups": { "type": ["null", "array"], "items": { - "type": ["null","string"] + "type": ["null", "string"] } }, "customers": { "type": ["null", "array"], "items": { - "type": ["null","string"] + "type": ["null", "string"] } }, "budgetCategories": { "type": ["null", "array"], "items": { - "type": ["null","object"] + "type": ["null", "object"] } }, "private": { diff --git a/airbyte-integrations/connectors/source-hubplanner/source_hubplanner/schemas/resources.json b/airbyte-integrations/connectors/source-hubplanner/source_hubplanner/schemas/resources.json index 004fd9af9261b..fc646a589cb02 100644 --- a/airbyte-integrations/connectors/source-hubplanner/source_hubplanner/schemas/resources.json +++ b/airbyte-integrations/connectors/source-hubplanner/source_hubplanner/schemas/resources.json @@ -45,7 +45,7 @@ "calendarIds": { "type": ["null", "array"], "items": { - "type": ["null","string"] + "type": ["null", "string"] } }, "isApprover": {