From e7a2c53333b05e1fc45736d17315e2cf6815dd84 Mon Sep 17 00:00:00 2001 From: Visnu Pitiyanuvath Date: Wed, 12 Apr 2023 08:26:02 -0700 Subject: [PATCH] Source Stripe: expand tiers when syncing plans (#19906) * Expand tiers when syncing plans * Update Plans stream schema * Re-bump * Bump * Remove string as a plan schema * bump * Update changelog --------- Co-authored-by: Sherif A. Nada Co-authored-by: sh4sh <6833405+sh4sh@users.noreply.github.com> Co-authored-by: Marcos Marx --- airbyte-integrations/connectors/source-stripe/Dockerfile | 2 +- .../source-stripe/source_stripe/schemas/plans.json | 8 +++++++- .../connectors/source-stripe/source_stripe/streams.py | 4 ++++ docs/integrations/sources/stripe.md | 3 ++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/airbyte-integrations/connectors/source-stripe/Dockerfile b/airbyte-integrations/connectors/source-stripe/Dockerfile index 520d0dea76f4..e40ccfaa4ac4 100644 --- a/airbyte-integrations/connectors/source-stripe/Dockerfile +++ b/airbyte-integrations/connectors/source-stripe/Dockerfile @@ -13,5 +13,5 @@ ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=3.0.5 +LABEL io.airbyte.version=3.1.0 LABEL io.airbyte.name=airbyte/source-stripe diff --git a/airbyte-integrations/connectors/source-stripe/source_stripe/schemas/plans.json b/airbyte-integrations/connectors/source-stripe/source_stripe/schemas/plans.json index 099b518427bc..3af88a962ca0 100644 --- a/airbyte-integrations/connectors/source-stripe/source_stripe/schemas/plans.json +++ b/airbyte-integrations/connectors/source-stripe/source_stripe/schemas/plans.json @@ -1,5 +1,5 @@ { - "type": ["null", "object", "string"], + "type": ["null", "object"], "properties": { "nickname": { "type": ["null", "string"] @@ -12,9 +12,15 @@ "flat_amount": { "type": ["null", "integer"] }, + "flat_amount_decimal": { + "type": ["null", "string"] + }, "unit_amount": { "type": ["null", "integer"] }, + "unit_amount_decimal": { + "type": ["null", "string"] + }, "up_to": { "type": ["null", "integer"] } diff --git a/airbyte-integrations/connectors/source-stripe/source_stripe/streams.py b/airbyte-integrations/connectors/source-stripe/source_stripe/streams.py index b39e4ad8a037..21209a0b15b4 100644 --- a/airbyte-integrations/connectors/source-stripe/source_stripe/streams.py +++ b/airbyte-integrations/connectors/source-stripe/source_stripe/streams.py @@ -422,6 +422,10 @@ class Plans(IncrementalStripeStream): def path(self, **kwargs): return "plans" + def request_params(self, stream_slice: Mapping[str, Any] = None, **kwargs): + params = super().request_params(stream_slice=stream_slice, **kwargs) + params["expand[]"] = ["data.tiers"] + return params class Products(IncrementalStripeStream): """ diff --git a/docs/integrations/sources/stripe.md b/docs/integrations/sources/stripe.md index 8f29c88dfadd..1c742210ac87 100644 --- a/docs/integrations/sources/stripe.md +++ b/docs/integrations/sources/stripe.md @@ -81,7 +81,8 @@ The Stripe connector should not run into Stripe API limitations under normal usa ## Changelog | Version | Date | Pull Request | Subject | -|:--------|:-----------|:---------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------| +| :------ | :--------- | :------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- | +| 3.1.0 | 2023-03-10 | [19906](https://github.com/airbytehq/airbyte/pull/19906) | Expand `tiers` when syncing `Plans` streams | | 3.0.5 | 2023-03-25 | [22866](https://github.com/airbytehq/airbyte/pull/22866) | Specified date formatting in specification | | 3.0.4 | 2023-03-24 | [24471](https://github.com/airbytehq/airbyte/pull/24471) | Fix stream slices for single sliced streams | | 3.0.3 | 2023-03-17 | [24179](https://github.com/airbytehq/airbyte/pull/24179) | Get customer's attributes safely |