diff --git a/source-google-ads/source_google_ads/custom_query_stream.py b/source-google-ads/source_google_ads/custom_query_stream.py index 2cf6066c48..84a585a1ae 100644 --- a/source-google-ads/source_google_ads/custom_query_stream.py +++ b/source-google-ads/source_google_ads/custom_query_stream.py @@ -21,8 +21,9 @@ def primary_key(self) -> str: It will be ignored if provided. If you need to enable it, uncomment the next line instead of `return None` and modify your config """ - # return self.config.get("primary_key") or None - return None + # TODO luis: Thats a quick hack to pass validation step with already created custom queries, will be removed along + # with the new custom query creation + return ["segments.date"] @property def name(self): diff --git a/source-google-ads/source_google_ads/source.py b/source-google-ads/source_google_ads/source.py index 5c93d1a5c1..e382fcb28d 100644 --- a/source-google-ads/source_google_ads/source.py +++ b/source-google-ads/source_google_ads/source.py @@ -49,7 +49,8 @@ def _validate_and_transform(config: Mapping[str, Any]): config.pop("end_date") for query in config.get("custom_queries", []): try: - query["query"] = GAQL.parse(query["query"]) + if type(query["query"]) == str: + query["query"] = GAQL.parse(query["query"]) except ValueError: message = f"The custom GAQL query {query['table_name']} failed. Validate your GAQL query with the Google Ads query validator. https://developers.google.com/google-ads/api/fields/v17/query_validator" raise AirbyteTracedException(message=message, failure_type=FailureType.config_error)