Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source-google-ads: fixing config transformations #2016

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions source-google-ads/source_google_ads/custom_query_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion source-google-ads/source_google_ads/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading