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

fix: Invalid key error for metric_filter and dimension_filter #187

Merged
merged 1 commit into from
May 5, 2024
Merged
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
12 changes: 6 additions & 6 deletions tap_google_analytics/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ def _generate_report_definition(report_def_raw):
for metric in report_def_raw["metrics"]:
report_definition["metrics"].append(Metric(name=metric))

if "metric_filter" in report_def_raw:
report_definition["metric_filter"] = report_def_raw["metric_filter"]
if "metricFilter" in report_def_raw:
report_definition["metricFilter"] = report_def_raw["metricFilter"]

if "dimension_filter" in report_def_raw:
report_definition["dimension_filter"] = report_def_raw["dimension_filter"]
if "dimensionFilter" in report_def_raw:
report_definition["dimensionFilter"] = report_def_raw["dimensionFilter"]

# Add segmentIds to the request if the stream contains them
if "segments" in report_def_raw:
Expand Down Expand Up @@ -264,8 +264,8 @@ def _query_api(self, report_definition, state_filter, pageToken=None) -> RunRepo
metrics=report_definition["metrics"],
date_ranges=[DateRange(start_date=state_filter, end_date=self.end_date)],
limit=self.page_size,
metric_filter=report_definition["metric_filter"],
dimension_filter=report_definition["dimension_filter"],
metric_filter=report_definition["metricFilter"],
dimension_filter=report_definition["dimensionFilter"],
offset=(pageToken or 0) * self.page_size,
)

Expand Down
Loading