Skip to content

Commit

Permalink
source-stripe: Add missing fields to invoices and subscriptions schem…
Browse files Browse the repository at this point in the history
…as and improve memory usage when reading from substreams (#34347)
  • Loading branch information
girarda authored and rodireich committed Jan 19, 2024
1 parent 694f38d commit b16d85e
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 23 deletions.

Large diffs are not rendered by default.

Expand Up @@ -10,7 +10,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: e094cb9a-26de-4645-8761-65c0c425d1de
dockerImageTag: 5.1.3
dockerImageTag: 5.2.0
dockerRepository: airbyte/source-stripe
documentationUrl: https://docs.airbyte.com/integrations/sources/stripe
githubIssueLabel: source-stripe
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-stripe/setup.py
Expand Up @@ -5,7 +5,7 @@

from setuptools import find_packages, setup

MAIN_REQUIREMENTS = ["airbyte-cdk==0.57.6", "stripe==2.56.0", "pendulum==2.1.2"]
MAIN_REQUIREMENTS = ["airbyte-cdk==0.58.9", "stripe==2.56.0", "pendulum==2.1.2"]

# we set `requests-mock~=1.11.0` to ensure concurrency is supported
TEST_REQUIREMENTS = ["pytest-mock~=3.6.1", "pytest~=6.1", "requests-mock~=1.11.0", "requests_mock~=1.8", "freezegun==1.2.2"]
Expand Down
Expand Up @@ -530,6 +530,14 @@
}
}
},
"issuer": {
"type": ["null", "object"],
"properties": {
"type": {
"type": ["null", "string"]
}
}
},
"latest_revision": {
"type": ["null", "string"]
},
Expand Down
Expand Up @@ -49,6 +49,12 @@
"billing_cycle_anchor": {
"type": ["null", "number"]
},
"billing_cycle_anchor_config": {
"type": ["null", "object"]
},
"invoice_settings": {
"type": ["null", "object"]
},
"cancel_at_period_end": {
"type": ["null", "boolean"]
},
Expand Down
Expand Up @@ -707,20 +707,6 @@ def read_records(self, sync_mode: SyncMode, stream_slice: Optional[Mapping[str,
items_next_pages = super().read_records(sync_mode=SyncMode.full_refresh, stream_slice=stream_slice, **kwargs)
yield from chain(items, items_next_pages)

def stream_slices(
self, sync_mode: SyncMode, cursor_field: Optional[List[str]] = None, stream_state: Optional[Mapping[str, Any]] = None
) -> Iterable[Optional[Mapping[str, Any]]]:
parent_stream_slices = self.parent.stream_slices(
sync_mode=SyncMode.full_refresh, cursor_field=cursor_field, stream_state=stream_state
)
for stream_slice in parent_stream_slices:
parent_records = self.parent.read_records(
sync_mode=SyncMode.full_refresh, cursor_field=cursor_field, stream_slice=stream_slice, stream_state=stream_state
)
for record in parent_records:
self.logger.info(f"Fetching parent stream slices for stream {self.name}.")
yield {"parent": record}


class IncrementalStripeLazySubStreamSelector(IStreamSelector):
def __init__(self, updated_cursor_incremental_stream: UpdatedCursorIncrementalStripeStream, lazy_sub_stream: StripeLazySubStream):
Expand Down
5 changes: 3 additions & 2 deletions docs/integrations/sources/stripe.md
Expand Up @@ -216,9 +216,10 @@ Each record is marked with `is_deleted` flag when the appropriate event happens

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:-------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 5.2.0 | 2024-01-18 | [34347](https://github.com/airbytehq/airbyte/pull//34347) | Add new fields invoices and subscription streams. Upgrade the CDK for better memory usage. |
| 5.1.3 | 2023-12-18 | [33306](https://github.com/airbytehq/airbyte/pull/33306/) | Adding integration tests |
| 5.1.2 | 2024-01-04 | [33414](https://github.com/airbytehq/airbyte/pull/33414) | Prepare for airbyte-lib |
| 5.1.1 | 2024-01-04 | [33926](https://github.com/airbytehq/airbyte/pull/33926/) | Update endpoint for `bank_accounts` stream |
| 5.1.2 | 2024-01-04 | [33414](https://github.com/airbytehq/airbyte/pull/33414) | Prepare for airbyte-lib |
| 5.1.1 | 2024-01-04 | [33926](https://github.com/airbytehq/airbyte/pull/33926/) | Update endpoint for `bank_accounts` stream |
| 5.1.0 | 2023-12-11 | [32908](https://github.com/airbytehq/airbyte/pull/32908/) | Read full refresh streams concurrently |
| 5.0.2 | 2023-12-01 | [33038](https://github.com/airbytehq/airbyte/pull/33038) | Add stream slice logging for SubStream |
| 5.0.1 | 2023-11-17 | [32638](https://github.com/airbytehq/airbyte/pull/32638/) | Availability stretegy: check availability of both endpoints (if applicable) - common API + events API |
Expand Down

0 comments on commit b16d85e

Please sign in to comment.