airbyte-source-google-search-console 1.5.16.dev202503142015__py3-none-any.whl → 1.5.16.dev202505021903__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: airbyte-source-google-search-console
3
- Version: 1.5.16.dev202503142015
3
+ Version: 1.5.16.dev202505021903
4
4
  Summary: Source implementation for Google Search Console.
5
5
  License: Elv2
6
6
  Author: Airbyte
@@ -17,10 +17,10 @@ source_google_search_console/schemas/search_analytics_site_report_by_site.json,s
17
17
  source_google_search_console/schemas/sitemaps.json,sha256=coyPSZCAfzMheybfRp4WPAZCp5JF2KGRF2rWK8oC080,1775
18
18
  source_google_search_console/schemas/sites.json,sha256=WNiCRuStPL1YkJiFa8FEbNJmqaERAOf9Yow6ygIumvo,383
19
19
  source_google_search_console/service_account_authenticator.py,sha256=gjUxt0xFxj82uviCQNTsA1Jlee__UDhYNjE7bRO1G0U,1227
20
- source_google_search_console/source.py,sha256=8n10_agSa2rvPvEyBvOfOpmpEardbEhi3H0vlK2A4_g,10002
21
- source_google_search_console/spec.json,sha256=WYtFvaSqWYGm1Dt2yV9G92U78Q94rh9oarbxJe3H7xo,8470
22
- source_google_search_console/streams.py,sha256=argw9ECCf7nInvrg_B5BgWa59gqL_ecvpFGbWf6tCsE,22275
23
- airbyte_source_google_search_console-1.5.16.dev202503142015.dist-info/METADATA,sha256=VPW3sTOMZUXbxtWilCnJ1rGS59MEmx5_orqs4Mh1fGM,5646
24
- airbyte_source_google_search_console-1.5.16.dev202503142015.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
25
- airbyte_source_google_search_console-1.5.16.dev202503142015.dist-info/entry_points.txt,sha256=DMcgc9bCX-Vt6hm_68pa77qS3eGdeMhg-UdlFc-XKUM,85
26
- airbyte_source_google_search_console-1.5.16.dev202503142015.dist-info/RECORD,,
20
+ source_google_search_console/source.py,sha256=Dv6es7XWq-eTinrjUI7wAsUU49mOlYsRiXh_OzqNkW4,10204
21
+ source_google_search_console/spec.json,sha256=2fFxbgga6veaSiQyfkoyAtVraSk8FgSGjDyT7T5ctBQ,8764
22
+ source_google_search_console/streams.py,sha256=E2Ib6AU0V5LCmA846_7ekIOmsrV2KX8VONWXMdhB3pc,19917
23
+ airbyte_source_google_search_console-1.5.16.dev202505021903.dist-info/METADATA,sha256=13H2rlconrDe1NF9D_0a8lOgT4N09qaNlLQesbFRMMU,5646
24
+ airbyte_source_google_search_console-1.5.16.dev202505021903.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
25
+ airbyte_source_google_search_console-1.5.16.dev202505021903.dist-info/entry_points.txt,sha256=DMcgc9bCX-Vt6hm_68pa77qS3eGdeMhg-UdlFc-XKUM,85
26
+ airbyte_source_google_search_console-1.5.16.dev202505021903.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.1
2
+ Generator: poetry-core 2.1.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -49,6 +49,7 @@ custom_reports_schema = {
49
49
  "properties": {
50
50
  "name": {"type": "string", "minLength": 1},
51
51
  "dimensions": {"type": "array", "items": {"type": "string", "minLength": 1}},
52
+ "aggregation_type": {"type": "string", "enum": ["auto", "by_page", "by_property"], "default": "auto"},
52
53
  },
53
54
  "required": ["name", "dimensions"],
54
55
  },
@@ -195,7 +196,9 @@ class SourceGoogleSearchConsole(AbstractSource):
195
196
 
196
197
  def get_custom_reports(self, config: Mapping[str, Any], stream_config: Mapping[str, Any]) -> List[Optional[Stream]]:
197
198
  return [
198
- type(report["name"], (SearchAnalyticsByCustomDimensions,), {})(dimensions=report["dimensions"], **stream_config)
199
+ type(report["name"], (SearchAnalyticsByCustomDimensions,), {})(
200
+ dimensions=report["dimensions"], aggregation_type=report.get("aggregation_type", "auto"), **stream_config
201
+ )
199
202
  for report in config.get("custom_reports_array", [])
200
203
  ]
201
204
 
@@ -144,6 +144,13 @@
144
144
  },
145
145
  "default": ["date"],
146
146
  "minItems": 0
147
+ },
148
+ "aggregation_type": {
149
+ "title": "Aggregation Type",
150
+ "description": "The type of aggregation to apply to the report.",
151
+ "type": "string",
152
+ "enum": ["auto", "by_page", "by_property"],
153
+ "default": "auto"
147
154
  }
148
155
  },
149
156
  "required": ["name", "dimensions"]
@@ -371,20 +371,6 @@ class SearchAppearance(SearchAnalytics):
371
371
  primary_key = None
372
372
  dimensions = ["searchAppearance"]
373
373
 
374
- def request_body_json(
375
- self,
376
- stream_state: Mapping[str, Any] = None,
377
- stream_slice: Mapping[str, Any] = None,
378
- next_page_token: Mapping[str, Any] = None,
379
- ) -> Optional[Union[Dict[str, Any], str]]:
380
- data = super().request_body_json(stream_state, stream_slice, next_page_token)
381
-
382
- fields_to_remove = ["aggregationType", "startRow", "rowLimit", "dataState"]
383
- for field in fields_to_remove:
384
- data.pop(field, None)
385
-
386
- return data
387
-
388
374
 
389
375
  class SearchByKeyword(SearchAnalytics):
390
376
  """
@@ -395,14 +381,12 @@ class SearchByKeyword(SearchAnalytics):
395
381
  filters: {"dimension": "searchAppearance", "operator": "equals", "expression": keyword}
396
382
  """
397
383
 
398
- search_types = ["web", "news", "image", "video", "discover", "googleNews"]
399
-
400
384
  def stream_slices(
401
385
  self, sync_mode: SyncMode, cursor_field: List[str] = None, stream_state: Mapping[str, Any] = None
402
386
  ) -> Iterable[Optional[Mapping[str, Any]]]:
403
387
  search_appearance_stream = SearchAppearance(self._session.auth, self._site_urls, self._start_date, self._end_date)
404
388
 
405
- for stream_slice in super().stream_slices(sync_mode, cursor_field, stream_state):
389
+ for stream_slice in super().stream_slices(sync_mode, cursor_field, stream_state):
406
390
  keywords_records = search_appearance_stream.read_records(
407
391
  sync_mode=SyncMode.full_refresh, stream_state=stream_state, stream_slice=stream_slice
408
392
  )
@@ -411,7 +395,6 @@ class SearchByKeyword(SearchAnalytics):
411
395
  for keyword in keywords:
412
396
  filters = {"dimension": "searchAppearance", "operator": "equals", "expression": keyword}
413
397
  stream_slice["dimensionFilterGroups"] = [{"groupType": "and", "filters": filters}]
414
- stream_slice["dimensions"] = self.dimensions
415
398
 
416
399
  yield stream_slice
417
400
 
@@ -429,18 +412,6 @@ class SearchByKeyword(SearchAnalytics):
429
412
  class SearchAnalyticsKeywordPageReport(SearchByKeyword):
430
413
  primary_key = ["site_url", "date", "country", "device", "query", "page", "search_type"]
431
414
  dimensions = ["date", "country", "device", "query", "page"]
432
- def stream_slices(
433
- self, sync_mode: SyncMode, cursor_field: List[str] = None, stream_state: Mapping[str, Any] = None
434
- ) -> Iterable[Optional[Mapping[str, Any]]]:
435
- return super(SearchByKeyword, self).stream_slices(sync_mode, cursor_field, stream_state)
436
-
437
- def request_body_json(
438
- self,
439
- stream_state: Mapping[str, Any] = None,
440
- stream_slice: Mapping[str, Any] = None,
441
- next_page_token: Mapping[str, Any] = None,
442
- ) -> Optional[Union[Dict[str, Any], str]]:
443
- return super(SearchByKeyword, self).request_body_json(stream_state, stream_slice, next_page_token)
444
415
 
445
416
 
446
417
  class SearchAnalyticsKeywordSiteReportByPage(SearchByKeyword):
@@ -448,35 +419,11 @@ class SearchAnalyticsKeywordSiteReportByPage(SearchByKeyword):
448
419
  dimensions = ["date", "country", "device", "query"]
449
420
  aggregation_type = QueryAggregationType.by_page
450
421
 
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
454
-
455
- def request_body_json(
456
- self,
457
- stream_state: Mapping[str, Any] = None,
458
- stream_slice: Mapping[str, Any] = None,
459
- next_page_token: Mapping[str, Any] = None,
460
- ) -> Optional[Union[Dict[str, Any], str]]:
461
- return super(SearchByKeyword, self).request_body_json(stream_state, stream_slice, next_page_token)
462
422
 
463
423
  class SearchAnalyticsKeywordSiteReportBySite(SearchByKeyword):
464
424
  primary_key = ["site_url", "date", "country", "device", "query", "search_type"]
465
425
  dimensions = ["date", "country", "device", "query"]
466
426
  aggregation_type = QueryAggregationType.by_property
467
- def stream_slices(
468
- self, sync_mode: SyncMode, cursor_field: List[str] = None, stream_state: Mapping[str, Any] = None
469
- ) -> Iterable[Optional[Mapping[str, Any]]]:
470
- return super(SearchByKeyword, self).stream_slices(sync_mode, cursor_field, stream_state)
471
-
472
- def request_body_json(
473
- self,
474
- stream_state: Mapping[str, Any] = None,
475
- stream_slice: Mapping[str, Any] = None,
476
- next_page_token: Mapping[str, Any] = None,
477
- ) -> Optional[Union[Dict[str, Any], str]]:
478
- return super(SearchByKeyword, self).request_body_json(stream_state, stream_slice, next_page_token)
479
-
480
427
 
481
428
 
482
429
  class SearchAnalyticsSiteReportBySite(SearchAnalytics):
@@ -511,9 +458,10 @@ class SearchAnalyticsByCustomDimensions(SearchAnalytics):
511
458
 
512
459
  primary_key = None
513
460
 
514
- def __init__(self, dimensions: List[str], *args, **kwargs):
461
+ def __init__(self, dimensions: List[str], aggregation_type: str, *args, **kwargs):
515
462
  super(SearchAnalyticsByCustomDimensions, self).__init__(*args, **kwargs)
516
463
  self.dimensions = dimensions + [dimension for dimension in self.DEFAULT_DIMENSIONS if dimension not in dimensions]
464
+ self.aggregation_type = QueryAggregationType[aggregation_type]
517
465
  # Assign the dimensions as PK for the custom report stream.
518
466
  # Site URL and Search Type are included in the API call thus affect the resulting data.
519
467
  # `site_url` is a required URL param for making API calls;