Skip to content

Commit f64908d

Browse files
committed
update keyword streams
1 parent 89a42f0 commit f64908d

File tree

1 file changed

+11
-17
lines changed
  • airbyte-integrations/connectors/source-google-search-console/source_google_search_console

1 file changed

+11
-17
lines changed

airbyte-integrations/connectors/source-google-search-console/source_google_search_console/streams.py

+11-17
Original file line numberDiff line numberDiff line change
@@ -432,38 +432,33 @@ class SearchAnalyticsKeywordPageReport(SearchByKeyword):
432432
def stream_slices(
433433
self, sync_mode: SyncMode, cursor_field: List[str] = None, stream_state: Mapping[str, Any] = None
434434
) -> Iterable[Optional[Mapping[str, Any]]]:
435-
for stream_slice in super().stream_slices(sync_mode, cursor_field, stream_state):
436-
yield stream_slice
435+
return super(SearchByKeyword, self).stream_slices(sync_mode, cursor_field, stream_state)
437436

438437
def request_body_json(
439438
self,
440439
stream_state: Mapping[str, Any] = None,
441440
stream_slice: Mapping[str, Any] = None,
442441
next_page_token: Mapping[str, Any] = None,
443442
) -> Optional[Union[Dict[str, Any], str]]:
444-
data = super().request_body_json(stream_state, stream_slice, next_page_token)
445-
return data
443+
return super(SearchByKeyword, self).request_body_json(stream_state, stream_slice, next_page_token)
446444

447445

448446
class SearchAnalyticsKeywordSiteReportByPage(SearchByKeyword):
449447
primary_key = ["site_url", "date", "country", "device", "query", "search_type"]
450448
dimensions = ["date", "country", "device", "query"]
451449
aggregation_type = QueryAggregationType.by_page
452-
def stream_slices(
453-
self, sync_mode: SyncMode, cursor_field: List[str] = None, stream_state: Mapping[str, Any] = None
454-
) -> Iterable[Optional[Mapping[str, Any]]]:
455-
for stream_slice in super().stream_slices(sync_mode, cursor_field, stream_state):
456-
yield stream_slice
450+
451+
def stream_slices(self, sync_mode, cursor_field=None, stream_state=None):
452+
for stream_slice in super(SearchByKeyword, self).stream_slices(sync_mode, cursor_field, stream_state):
453+
yield stream_slice
457454

458455
def request_body_json(
459456
self,
460457
stream_state: Mapping[str, Any] = None,
461458
stream_slice: Mapping[str, Any] = None,
462459
next_page_token: Mapping[str, Any] = None,
463460
) -> Optional[Union[Dict[str, Any], str]]:
464-
data = super().request_body_json(stream_state, stream_slice, next_page_token)
465-
return data
466-
461+
return super(SearchByKeyword, self).request_body_json(stream_state, stream_slice, next_page_token)
467462

468463
class SearchAnalyticsKeywordSiteReportBySite(SearchByKeyword):
469464
primary_key = ["site_url", "date", "country", "device", "query", "search_type"]
@@ -472,17 +467,16 @@ class SearchAnalyticsKeywordSiteReportBySite(SearchByKeyword):
472467
def stream_slices(
473468
self, sync_mode: SyncMode, cursor_field: List[str] = None, stream_state: Mapping[str, Any] = None
474469
) -> Iterable[Optional[Mapping[str, Any]]]:
475-
for stream_slice in super().stream_slices(sync_mode, cursor_field, stream_state):
476-
yield stream_slice
477-
470+
return super(SearchByKeyword, self).stream_slices(sync_mode, cursor_field, stream_state)
471+
478472
def request_body_json(
479473
self,
480474
stream_state: Mapping[str, Any] = None,
481475
stream_slice: Mapping[str, Any] = None,
482476
next_page_token: Mapping[str, Any] = None,
483477
) -> Optional[Union[Dict[str, Any], str]]:
484-
data = super().request_body_json(stream_state, stream_slice, next_page_token)
485-
return data
478+
return super(SearchByKeyword, self).request_body_json(stream_state, stream_slice, next_page_token)
479+
486480

487481

488482
class SearchAnalyticsSiteReportBySite(SearchAnalytics):

0 commit comments

Comments
 (0)