airbyte-source-google-search-console 1.5.3__py3-none-any.whl → 1.5.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {airbyte_source_google_search_console-1.5.3.dist-info → airbyte_source_google_search_console-1.5.5.dist-info}/METADATA +1 -1
- {airbyte_source_google_search_console-1.5.3.dist-info → airbyte_source_google_search_console-1.5.5.dist-info}/RECORD +5 -5
- {airbyte_source_google_search_console-1.5.3.dist-info → airbyte_source_google_search_console-1.5.5.dist-info}/WHEEL +1 -1
- source_google_search_console/streams.py +21 -10
- {airbyte_source_google_search_console-1.5.3.dist-info → airbyte_source_google_search_console-1.5.5.dist-info}/entry_points.txt +0 -0
@@ -19,8 +19,8 @@ source_google_search_console/schemas/sites.json,sha256=WNiCRuStPL1YkJiFa8FEbNJmq
|
|
19
19
|
source_google_search_console/service_account_authenticator.py,sha256=ocSisT5IYegoZf4atsGm9u2lJCdmeSf_9o4q7YN3vD4,1225
|
20
20
|
source_google_search_console/source.py,sha256=S0IIPPiI6ixHMIaezNQO7sfIqVio2_xyQZWPhzhxS_4,10000
|
21
21
|
source_google_search_console/spec.json,sha256=WYtFvaSqWYGm1Dt2yV9G92U78Q94rh9oarbxJe3H7xo,8470
|
22
|
-
source_google_search_console/streams.py,sha256=
|
23
|
-
airbyte_source_google_search_console-1.5.
|
24
|
-
airbyte_source_google_search_console-1.5.
|
25
|
-
airbyte_source_google_search_console-1.5.
|
26
|
-
airbyte_source_google_search_console-1.5.
|
22
|
+
source_google_search_console/streams.py,sha256=uknk6Fuq47NxuLfElV6Wbk5qXxtMRC1XxQNFRLMQyq8,19821
|
23
|
+
airbyte_source_google_search_console-1.5.5.dist-info/METADATA,sha256=a-Ghfk1siW_zVOw0qN--peU5l0xpdqXYiUbbu2hdet0,5617
|
24
|
+
airbyte_source_google_search_console-1.5.5.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
25
|
+
airbyte_source_google_search_console-1.5.5.dist-info/entry_points.txt,sha256=DMcgc9bCX-Vt6hm_68pa77qS3eGdeMhg-UdlFc-XKUM,85
|
26
|
+
airbyte_source_google_search_console-1.5.5.dist-info/RECORD,,
|
@@ -374,8 +374,28 @@ class SearchByKeyword(SearchAnalytics):
|
|
374
374
|
"""
|
375
375
|
Adds searchAppearance value to dimensionFilterGroups in json body
|
376
376
|
https://developers.google.com/webmaster-tools/v1/how-tos/all-your-data#search-appearance-data
|
377
|
+
|
378
|
+
groupType: "and" - Whether all filters in this group must return true ("and"), or one or more must return true (not yet supported).
|
379
|
+
filters: {"dimension": "searchAppearance", "operator": "equals", "expression": keyword}
|
377
380
|
"""
|
378
381
|
|
382
|
+
def stream_slices(
|
383
|
+
self, sync_mode: SyncMode, cursor_field: List[str] = None, stream_state: Mapping[str, Any] = None
|
384
|
+
) -> Iterable[Optional[Mapping[str, Any]]]:
|
385
|
+
search_appearance_stream = SearchAppearance(self._session.auth, self._site_urls, self._start_date, self._end_date)
|
386
|
+
|
387
|
+
for stream_slice in super().stream_slices(sync_mode, cursor_field, stream_state):
|
388
|
+
keywords_records = search_appearance_stream.read_records(
|
389
|
+
sync_mode=SyncMode.full_refresh, stream_state=stream_state, stream_slice=stream_slice
|
390
|
+
)
|
391
|
+
keywords = {record["searchAppearance"] for record in keywords_records}
|
392
|
+
|
393
|
+
for keyword in keywords:
|
394
|
+
filters = {"dimension": "searchAppearance", "operator": "equals", "expression": keyword}
|
395
|
+
stream_slice["dimensionFilterGroups"] = [{"groupType": "and", "filters": filters}]
|
396
|
+
|
397
|
+
yield stream_slice
|
398
|
+
|
379
399
|
def request_body_json(
|
380
400
|
self,
|
381
401
|
stream_state: Mapping[str, Any] = None,
|
@@ -383,16 +403,7 @@ class SearchByKeyword(SearchAnalytics):
|
|
383
403
|
next_page_token: Mapping[str, Any] = None,
|
384
404
|
) -> Optional[Union[Dict[str, Any], str]]:
|
385
405
|
data = super().request_body_json(stream_state, stream_slice, next_page_token)
|
386
|
-
|
387
|
-
stream = SearchAppearance(self._session.auth, self._site_urls, self._start_date, self._end_date)
|
388
|
-
keywords_records = stream.read_records(sync_mode=SyncMode.full_refresh, stream_state=stream_state, stream_slice=stream_slice)
|
389
|
-
keywords = {record["searchAppearance"] for record in keywords_records}
|
390
|
-
filters = []
|
391
|
-
for keyword in keywords:
|
392
|
-
filters.append({"dimension": "searchAppearance", "operator": "equals", "expression": keyword})
|
393
|
-
|
394
|
-
data["dimensionFilterGroups"] = [{"filters": filters}]
|
395
|
-
|
406
|
+
data["dimensionFilterGroups"] = stream_slice["dimensionFilterGroups"]
|
396
407
|
return data
|
397
408
|
|
398
409
|
|