Skip to content

Commit 06802d7

Browse files
committed
added comments
1 parent b56e437 commit 06802d7

File tree

1 file changed

+8
-1
lines changed
  • airbyte-integrations/connectors/source-google-ads/source_google_ads

1 file changed

+8
-1
lines changed

airbyte-integrations/connectors/source-google-ads/source_google_ads/streams.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class IncrementalGoogleAdsStream(GoogleAdsStream, ABC):
6969
days_of_data_storage = None
7070
cursor_field = "segments.date"
7171
primary_key = None
72-
range_days = 15
72+
range_days = 15 # date range is set to 15 days, because for conversion_window_days default value is 14. Range less than 15 days will break the integration tests.
7373

7474
def __init__(self, start_date: str, conversion_window_days: int, time_zone: [pendulum.timezone, str], **kwargs):
7575
self.conversion_window_days = conversion_window_days
@@ -90,6 +90,13 @@ def stream_slices(self, stream_state: Mapping[str, Any] = None, **kwargs) -> Ite
9090
)
9191

9292
def get_date_params(self, stream_slice: Mapping[str, Any], cursor_field: str, end_date: pendulum.datetime = None):
93+
"""
94+
Returns `start_date` and `end_date` for the given stream_slice.
95+
If (end_date - start_date) is a big date range (>= 1 month), it can take more than 2 hours to process all the records from the given slice.
96+
After 2 hours next page tokens will be expired, finally resulting in page token expired error
97+
Currently this method returns `start_date` and `end_date` with 15 days difference.
98+
"""
99+
93100
end_date = end_date or pendulum.yesterday(tz=self.time_zone)
94101
start_date = pendulum.parse(stream_slice.get(cursor_field))
95102
if start_date > pendulum.now():

0 commit comments

Comments
 (0)