From 61dfaeec3e9a682db0dbc15e41bea4c9a538793c Mon Sep 17 00:00:00 2001 From: William Kaper Date: Wed, 11 Dec 2024 07:55:43 -0500 Subject: [PATCH 1/2] First attempt at a fix --- airbyte-integrations/connectors/source-stripe/metadata.yaml | 2 +- airbyte-integrations/connectors/source-stripe/pyproject.toml | 2 +- .../connectors/source-stripe/source_stripe/source.py | 5 ++--- docs/integrations/sources/stripe.md | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/airbyte-integrations/connectors/source-stripe/metadata.yaml b/airbyte-integrations/connectors/source-stripe/metadata.yaml index e4bc2781dfd10..d823cbea97bf4 100644 --- a/airbyte-integrations/connectors/source-stripe/metadata.yaml +++ b/airbyte-integrations/connectors/source-stripe/metadata.yaml @@ -10,7 +10,7 @@ data: connectorSubtype: api connectorType: source definitionId: e094cb9a-26de-4645-8761-65c0c425d1de - dockerImageTag: 5.8.1 + dockerImageTag: 5.8.2 dockerRepository: airbyte/source-stripe documentationUrl: https://docs.airbyte.com/integrations/sources/stripe erdUrl: https://dbdocs.io/airbyteio/source-stripe?view=relationships diff --git a/airbyte-integrations/connectors/source-stripe/pyproject.toml b/airbyte-integrations/connectors/source-stripe/pyproject.toml index ece2de050e8dc..86b794867c916 100644 --- a/airbyte-integrations/connectors/source-stripe/pyproject.toml +++ b/airbyte-integrations/connectors/source-stripe/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",] build-backend = "poetry.core.masonry.api" [tool.poetry] -version = "5.8.1" +version = "5.8.2" name = "source-stripe" description = "Source implementation for Stripe." authors = [ "Airbyte ",] diff --git a/airbyte-integrations/connectors/source-stripe/source_stripe/source.py b/airbyte-integrations/connectors/source-stripe/source_stripe/source.py index 4b25d9df9c8cd..5ce96c24cc825 100644 --- a/airbyte-integrations/connectors/source-stripe/source_stripe/source.py +++ b/airbyte-integrations/connectors/source-stripe/source_stripe/source.py @@ -504,12 +504,11 @@ def streams(self, config: MutableMapping[str, Any]) -> List[Stream]: event_types=["topup.canceled", "topup.created", "topup.failed", "topup.reversed", "topup.succeeded"], **args, ), - UpdatedCursorIncrementalStripeSubStream( + ParentIncrementalStripeSubStream( name="customer_balance_transactions", path=lambda self, stream_slice, *args, **kwargs: f"customers/{stream_slice['parent']['id']}/balance_transactions", parent=self.customers(**args), - legacy_cursor_field="created", - event_types=["customer_cash_balance_transaction.*"], + cursor_field="created", **args, ), UpdatedCursorIncrementalStripeLazySubStream( diff --git a/docs/integrations/sources/stripe.md b/docs/integrations/sources/stripe.md index f6c0d854219fd..f958aac8623df 100644 --- a/docs/integrations/sources/stripe.md +++ b/docs/integrations/sources/stripe.md @@ -246,7 +246,8 @@ Each record is marked with `is_deleted` flag when the appropriate event happens | Version | Date | Pull Request | Subject | |:--------|:-----------|:----------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| 5.8.1 | 2024-12-08 | [46499](https://github.com/airbytehq/airbyte/pull/46499) | Source-Stripe: Add new payout_balance_transactions incremental stream +| 5.8.2 | 2024-12-10 | [46499](https://github.com/airbytehq/airbyte/pull/46499) | Source-Stripe: Refactor Customer Balance Transactions | +| 5.8.1 | 2024-12-08 | [46499](https://github.com/airbytehq/airbyte/pull/46499) | Source-Stripe: Add new payout_balance_transactions incremental stream | | 5.8.0 | 2024-10-12 | [46864](https://github.com/airbytehq/airbyte/pull/46864) | Add incremental stream support to `accounts` stream | | 5.7.0 | 2024-10-01 | [45860](https://github.com/airbytehq/airbyte/pull/45860) | Add incremental stream support to `invoice_line_items` and `subscription_items` streams | | 5.6.2 | 2024-10-05 | [43881](https://github.com/airbytehq/airbyte/pull/43881) | Update dependencies | From 9dd777e98689738ec772cd0358f6fd122a349e89 Mon Sep 17 00:00:00 2001 From: William Kaper Date: Mon, 16 Dec 2024 11:09:15 -0500 Subject: [PATCH 2/2] Removed updated column --- .../connectors/source-stripe/erd/discovered_catalog.json | 8 +++----- .../connectors/source-stripe/erd/source.dbml | 1 - .../source-stripe/integration_tests/abnormal_state.json | 2 +- .../integration_tests/configured_catalog.json | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/airbyte-integrations/connectors/source-stripe/erd/discovered_catalog.json b/airbyte-integrations/connectors/source-stripe/erd/discovered_catalog.json index 1de60ea0f66da..230c8b9161cfb 100644 --- a/airbyte-integrations/connectors/source-stripe/erd/discovered_catalog.json +++ b/airbyte-integrations/connectors/source-stripe/erd/discovered_catalog.json @@ -850,10 +850,6 @@ "description": "The date and time when the transaction was created", "type": ["null", "integer"] }, - "updated": { - "description": "The date and time when the transaction was created", - "type": ["null", "integer"] - }, "credit_note": { "description": "Credit note related to the balance transaction", "type": ["null", "string"] @@ -893,7 +889,9 @@ } } }, - "supported_sync_modes": ["full_refresh"], + "supported_sync_modes": ["full_refresh", "incremental"], + "source_defined_cursor": true, + "default_cursor_field": ["created"], "source_defined_primary_key": [["id"]], "is_resumable": true }, diff --git a/airbyte-integrations/connectors/source-stripe/erd/source.dbml b/airbyte-integrations/connectors/source-stripe/erd/source.dbml index c684407ac64c6..53bc467b87b79 100644 --- a/airbyte-integrations/connectors/source-stripe/erd/source.dbml +++ b/airbyte-integrations/connectors/source-stripe/erd/source.dbml @@ -68,7 +68,6 @@ Table "customer_balance_transactions" { "livemode" boolean "metadata" object "type" string - "updated" integer } Table "events" { diff --git a/airbyte-integrations/connectors/source-stripe/integration_tests/abnormal_state.json b/airbyte-integrations/connectors/source-stripe/integration_tests/abnormal_state.json index 788908058de68..2f1fc983ccb86 100644 --- a/airbyte-integrations/connectors/source-stripe/integration_tests/abnormal_state.json +++ b/airbyte-integrations/connectors/source-stripe/integration_tests/abnormal_state.json @@ -296,7 +296,7 @@ { "type": "STREAM", "stream": { - "stream_state": { "updated": 10000000000 }, + "stream_state": { "created": 10000000000 }, "stream_descriptor": { "name": "customer_balance_transactions" } } }, diff --git a/airbyte-integrations/connectors/source-stripe/integration_tests/configured_catalog.json b/airbyte-integrations/connectors/source-stripe/integration_tests/configured_catalog.json index afcfc99ea0c43..da8999b4a3445 100644 --- a/airbyte-integrations/connectors/source-stripe/integration_tests/configured_catalog.json +++ b/airbyte-integrations/connectors/source-stripe/integration_tests/configured_catalog.json @@ -187,7 +187,7 @@ "json_schema": {}, "supported_sync_modes": ["full_refresh", "incremental"], "source_defined_cursor": true, - "default_cursor_field": ["updated"], + "default_cursor_field": ["created"], "source_defined_primary_key": [["id"]] }, "primary_key": [["id"]],