diff --git a/source-braintree-native/source_braintree_native/api.py b/source-braintree-native/source_braintree_native/api.py index 0d2b72074..502d9ec45 100644 --- a/source-braintree-native/source_braintree_native/api.py +++ b/source-braintree-native/source_braintree_native/api.py @@ -95,7 +95,7 @@ async def fetch_transactions( ) -> AsyncGenerator[IncrementalResource | LogCursor, None]: assert isinstance(log_cursor, datetime) most_recent_created_at = log_cursor - window_end = log_cursor + timedelta(days=window_size) + window_end = log_cursor + timedelta(hours=window_size) end = min(window_end, datetime.now(tz=UTC)) collection = braintree_gateway.transaction.search( @@ -129,7 +129,7 @@ async def fetch_customers( ) -> AsyncGenerator[IncrementalResource | LogCursor, None]: assert isinstance(log_cursor, datetime) most_recent_created_at = log_cursor - window_end = log_cursor + timedelta(days=window_size) + window_end = log_cursor + timedelta(hours=window_size) end = min(window_end, datetime.now(tz=UTC)) collection = braintree_gateway.customer.search( @@ -163,7 +163,7 @@ async def fetch_credit_card_verifications( ) -> AsyncGenerator[IncrementalResource | LogCursor, None]: assert isinstance(log_cursor, datetime) most_recent_created_at = log_cursor - window_end = log_cursor + timedelta(days=window_size) + window_end = log_cursor + timedelta(hours=window_size) end = min(window_end, datetime.now(tz=UTC)) collection = braintree_gateway.verification.search( @@ -197,7 +197,7 @@ async def fetch_subscriptions( ) -> AsyncGenerator[IncrementalResource | LogCursor, None]: assert isinstance(log_cursor, datetime) most_recent_created_at = log_cursor - window_end = log_cursor + timedelta(days=window_size) + window_end = log_cursor + timedelta(hours=window_size) end = min(window_end, datetime.now(tz=UTC)) collection = braintree_gateway.subscription.search( @@ -234,7 +234,7 @@ async def fetch_disputes( # The start date must be shifted back 1 day since we have to query Braintree using the received_date field, # which is less granular than the created_at cursor field (date vs. datetime). start = log_cursor - timedelta(days=1) - window_end = log_cursor + timedelta(days=window_size) + window_end = log_cursor + timedelta(hours=window_size) end = min(window_end, datetime.now(tz=UTC)) collection = braintree_gateway.dispute.search( diff --git a/source-braintree-native/source_braintree_native/models.py b/source-braintree-native/source_braintree_native/models.py index b0080418c..086b99e7e 100644 --- a/source-braintree-native/source_braintree_native/models.py +++ b/source-braintree-native/source_braintree_native/models.py @@ -53,9 +53,9 @@ class Advanced(BaseModel): default=False, ) window_size: Annotated[int, Field( - description="Window size in days for incremental streams. This should be left as the default value unless connector errors indicate a smaller window size is required.", + description="Window size in hours for incremental streams. This should be left as the default value unless connector errors indicate a smaller window size is required.", title="Window Size", - default=15, + default=24, gt=0, )] diff --git a/source-braintree-native/tests/snapshots/snapshots__spec__capture.stdout.json b/source-braintree-native/tests/snapshots/snapshots__spec__capture.stdout.json index dd0bd8972..11b2252d3 100644 --- a/source-braintree-native/tests/snapshots/snapshots__spec__capture.stdout.json +++ b/source-braintree-native/tests/snapshots/snapshots__spec__capture.stdout.json @@ -12,8 +12,8 @@ "type": "boolean" }, "window_size": { - "default": 15, - "description": "Window size in days for incremental streams. This should be left as the default value unless connector errors indicate a smaller window size is required.", + "default": 24, + "description": "Window size in hours for incremental streams. This should be left as the default value unless connector errors indicate a smaller window size is required.", "exclusiveMinimum": 0, "title": "Window Size", "type": "integer"