airbyte-source-google-search-console 1.5.16.dev202503252224__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.
- {airbyte_source_google_search_console-1.5.16.dev202503252224.dist-info → airbyte_source_google_search_console-1.5.16.dev202505021903.dist-info}/METADATA +1 -1
- {airbyte_source_google_search_console-1.5.16.dev202503252224.dist-info → airbyte_source_google_search_console-1.5.16.dev202505021903.dist-info}/RECORD +7 -7
- {airbyte_source_google_search_console-1.5.16.dev202503252224.dist-info → airbyte_source_google_search_console-1.5.16.dev202505021903.dist-info}/WHEEL +1 -1
- source_google_search_console/source.py +4 -1
- source_google_search_console/spec.json +7 -0
- source_google_search_console/streams.py +9 -16
- {airbyte_source_google_search_console-1.5.16.dev202503252224.dist-info → airbyte_source_google_search_console-1.5.16.dev202505021903.dist-info}/entry_points.txt +0 -0
@@ -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=
|
21
|
-
source_google_search_console/spec.json,sha256=
|
22
|
-
source_google_search_console/streams.py,sha256=
|
23
|
-
airbyte_source_google_search_console-1.5.16.
|
24
|
-
airbyte_source_google_search_console-1.5.16.
|
25
|
-
airbyte_source_google_search_console-1.5.16.
|
26
|
-
airbyte_source_google_search_console-1.5.16.
|
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,,
|
@@ -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,), {})(
|
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"]
|
@@ -390,19 +390,12 @@ class SearchByKeyword(SearchAnalytics):
|
|
390
390
|
keywords_records = search_appearance_stream.read_records(
|
391
391
|
sync_mode=SyncMode.full_refresh, stream_state=stream_state, stream_slice=stream_slice
|
392
392
|
)
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
filters = {"dimension": "searchAppearance", "operator": "equals", "expression": keyword}
|
400
|
-
# Create a copy to avoid modifying the original stream_slice
|
401
|
-
stream_slice_with_filter = stream_slice.copy()
|
402
|
-
stream_slice_with_filter["dimensionFilterGroups"] = [{"groupType": "and", "filters": [filters]}]
|
403
|
-
yield stream_slice_with_filter
|
404
|
-
else:
|
405
|
-
# If no keywords are found, yield the base slice without filters
|
393
|
+
keywords = {record["searchAppearance"] for record in keywords_records}
|
394
|
+
|
395
|
+
for keyword in keywords:
|
396
|
+
filters = {"dimension": "searchAppearance", "operator": "equals", "expression": keyword}
|
397
|
+
stream_slice["dimensionFilterGroups"] = [{"groupType": "and", "filters": filters}]
|
398
|
+
|
406
399
|
yield stream_slice
|
407
400
|
|
408
401
|
def request_body_json(
|
@@ -412,8 +405,7 @@ class SearchByKeyword(SearchAnalytics):
|
|
412
405
|
next_page_token: Mapping[str, Any] = None,
|
413
406
|
) -> Optional[Union[Dict[str, Any], str]]:
|
414
407
|
data = super().request_body_json(stream_state, stream_slice, next_page_token)
|
415
|
-
|
416
|
-
data["dimensionFilterGroups"] = stream_slice["dimensionFilterGroups"]
|
408
|
+
data["dimensionFilterGroups"] = stream_slice["dimensionFilterGroups"]
|
417
409
|
return data
|
418
410
|
|
419
411
|
|
@@ -466,9 +458,10 @@ class SearchAnalyticsByCustomDimensions(SearchAnalytics):
|
|
466
458
|
|
467
459
|
primary_key = None
|
468
460
|
|
469
|
-
def __init__(self, dimensions: List[str], *args, **kwargs):
|
461
|
+
def __init__(self, dimensions: List[str], aggregation_type: str, *args, **kwargs):
|
470
462
|
super(SearchAnalyticsByCustomDimensions, self).__init__(*args, **kwargs)
|
471
463
|
self.dimensions = dimensions + [dimension for dimension in self.DEFAULT_DIMENSIONS if dimension not in dimensions]
|
464
|
+
self.aggregation_type = QueryAggregationType[aggregation_type]
|
472
465
|
# Assign the dimensions as PK for the custom report stream.
|
473
466
|
# Site URL and Search Type are included in the API call thus affect the resulting data.
|
474
467
|
# `site_url` is a required URL param for making API calls;
|