Skip to content

Commit

Permalink
fix google ads custom query validation if segments.date already prese…
Browse files Browse the repository at this point in the history
…nt in query
  • Loading branch information
nidhilashkari17 authored and debanjan97 committed Dec 6, 2023
1 parent 4db49cc commit a685fbe
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ def insert_segments_date_expr(query: GAQL, start_date: str, end_date: str) -> GA
query = query.append_field("segments.date")
condition = f"segments.date BETWEEN '{start_date}' AND '{end_date}'"
if query.where:
return query.set_where(query.where + " AND " + condition)
if "segments.date" not in query.where:
return query.set_where(query.where + " AND " + condition)
else:
return query.set_where(query.where)
return query.set_where(condition)


Expand Down

0 comments on commit a685fbe

Please sign in to comment.