From b50a4487e3767e4cf6254b7c8e253f1b5e7f63b6 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sun, 7 Nov 2021 10:28:11 +0000 Subject: [PATCH 1/4] chore: delete owlbot.py --- owlbot.py | 71 ------------------------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 owlbot.py diff --git a/owlbot.py b/owlbot.py deleted file mode 100644 index 98cb83e..0000000 --- a/owlbot.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" -import os - -import synthtool as s -import synthtool.gcp as gcp -from synthtool.languages import python - -common = gcp.CommonTemplates() - -default_version = "v1beta" - -for library in s.get_staging_dirs(default_version): - s.move( - library, - excludes=[ - "setup.py", - "README.rst", - "docs/index.rst", - f"scripts/fixup_data_{library.name}_keywords.py", - ], - ) - -s.remove_staging_dirs() - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(cov_level=99, microgenerator=True) -python.py_samples(skip_readmes=True) -s.move( - templated_files, excludes=[ - ".coveragerc" - ] -) # the microgenerator has a good coveragerc file - -# fix coverage target -s.replace( - "noxfile.py", - """(\s+)["']--cov=google.cloud["'],""", - """"--cov=google.analytics",""", -) - -# Wrap regex in docstring that sphinx thinks is a link with `` -s.replace( - "google/**/data.py", - '''"\^\[a-zA-Z0-9_\]\$"''', - """``^[a-zA-Z0-9_]$``""", -) - -# Block pushing non-cloud libraries to Cloud RAD -s.replace( - ".kokoro/docs/common.cfg", - r'value: "docs-staging-v2"', - r'value: "docs-staging-v2-staging"' -) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) From 9599c57a1382eeeee9ec7fe51b04666b23a31c32 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sun, 7 Nov 2021 10:29:48 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- docs/index.rst | 15 +++++++++++++-- noxfile.py | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 973b5b9..9706475 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2,6 +2,10 @@ .. include:: multiprocessing.rst +This package includes clients for multiple versions of Analytics Data API. +By default, you will get version ``data_v1beta``. + + API Reference ------------- .. toctree:: @@ -9,15 +13,22 @@ API Reference data_v1beta/services data_v1beta/types + +API Reference +------------- +.. toctree:: + :maxdepth: 2 + data_v1alpha/services data_v1alpha/types + Changelog --------- For a list of all ``google-analytics-data`` releases: .. toctree:: - :maxdepth: 2 + :maxdepth: 2 - changelog + changelog diff --git a/noxfile.py b/noxfile.py index de41c6b..2a2001c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -175,7 +175,7 @@ def cover(session): test runs (not system test runs), and then erases coverage data. """ session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=99") + session.run("coverage", "report", "--show-missing", "--fail-under=100") session.run("coverage", "erase") From 7542f4fb501ac0ebef1bb85f19ab3b9e593fbcc7 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sun, 14 Nov 2021 16:19:20 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- samples/snippets/run_batch_report.py | 4 +--- samples/snippets/run_pivot_report.py | 9 ++------- samples/snippets/run_report_with_property_quota.py | 4 +--- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/samples/snippets/run_batch_report.py b/samples/snippets/run_batch_report.py index dfd155e..5d8900a 100644 --- a/samples/snippets/run_batch_report.py +++ b/samples/snippets/run_batch_report.py @@ -56,9 +56,7 @@ def run_batch_report(property_id="YOUR-GA4-PROPERTY-ID"): date_ranges=[DateRange(start_date="2021-01-03", end_date="2021-01-09")], ), RunReportRequest( - dimensions=[ - Dimension(name="browser"), - ], + dimensions=[Dimension(name="browser"),], metrics=[Metric(name="activeUsers")], date_ranges=[DateRange(start_date="2021-01-01", end_date="2021-01-31")], ), diff --git a/samples/snippets/run_pivot_report.py b/samples/snippets/run_pivot_report.py index dc3ce91..d423ec5 100644 --- a/samples/snippets/run_pivot_report.py +++ b/samples/snippets/run_pivot_report.py @@ -45,9 +45,7 @@ def run_pivot_report(property_id="YOUR-GA4-PROPERTY-ID"): request = RunPivotReportRequest( property=f"properties/{property_id}", - date_ranges=[ - DateRange(start_date="2021-01-01", end_date="2021-01-30"), - ], + date_ranges=[DateRange(start_date="2021-01-01", end_date="2021-01-30"),], pivots=[ Pivot( field_names=["country"], @@ -70,10 +68,7 @@ def run_pivot_report(property_id="YOUR-GA4-PROPERTY-ID"): ), ], metrics=[Metric(name="sessions")], - dimensions=[ - Dimension(name="country"), - Dimension(name="browser"), - ], + dimensions=[Dimension(name="country"), Dimension(name="browser"),], ) response = client.run_pivot_report(request) print_run_pivot_report_response(response) diff --git a/samples/snippets/run_report_with_property_quota.py b/samples/snippets/run_report_with_property_quota.py index f62414a..1264993 100644 --- a/samples/snippets/run_report_with_property_quota.py +++ b/samples/snippets/run_report_with_property_quota.py @@ -44,9 +44,7 @@ def run_report_with_property_quota(property_id="YOUR-GA4-PROPERTY-ID"): property=f"properties/{property_id}", return_property_quota=True, dimensions=[Dimension(name="country")], - metrics=[ - Metric(name="activeUsers"), - ], + metrics=[Metric(name="activeUsers"),], date_ranges=[DateRange(start_date="7daysAgo", end_date="today")], ) response = client.run_report(request) From 0b577539d6fedaff85454b631e2dc27697919c99 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Tue, 16 Nov 2021 12:00:03 +0000 Subject: [PATCH 4/4] lint --- samples/snippets/run_batch_report.py | 2 +- samples/snippets/run_pivot_report.py | 4 ++-- samples/snippets/run_report_with_property_quota.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/snippets/run_batch_report.py b/samples/snippets/run_batch_report.py index 5d8900a..1915dbc 100644 --- a/samples/snippets/run_batch_report.py +++ b/samples/snippets/run_batch_report.py @@ -56,7 +56,7 @@ def run_batch_report(property_id="YOUR-GA4-PROPERTY-ID"): date_ranges=[DateRange(start_date="2021-01-03", end_date="2021-01-09")], ), RunReportRequest( - dimensions=[Dimension(name="browser"),], + dimensions=[Dimension(name="browser")], metrics=[Metric(name="activeUsers")], date_ranges=[DateRange(start_date="2021-01-01", end_date="2021-01-31")], ), diff --git a/samples/snippets/run_pivot_report.py b/samples/snippets/run_pivot_report.py index d423ec5..3400870 100644 --- a/samples/snippets/run_pivot_report.py +++ b/samples/snippets/run_pivot_report.py @@ -45,7 +45,7 @@ def run_pivot_report(property_id="YOUR-GA4-PROPERTY-ID"): request = RunPivotReportRequest( property=f"properties/{property_id}", - date_ranges=[DateRange(start_date="2021-01-01", end_date="2021-01-30"),], + date_ranges=[DateRange(start_date="2021-01-01", end_date="2021-01-30")], pivots=[ Pivot( field_names=["country"], @@ -68,7 +68,7 @@ def run_pivot_report(property_id="YOUR-GA4-PROPERTY-ID"): ), ], metrics=[Metric(name="sessions")], - dimensions=[Dimension(name="country"), Dimension(name="browser"),], + dimensions=[Dimension(name="country"), Dimension(name="browser")], ) response = client.run_pivot_report(request) print_run_pivot_report_response(response) diff --git a/samples/snippets/run_report_with_property_quota.py b/samples/snippets/run_report_with_property_quota.py index 1264993..76bc3d3 100644 --- a/samples/snippets/run_report_with_property_quota.py +++ b/samples/snippets/run_report_with_property_quota.py @@ -44,7 +44,7 @@ def run_report_with_property_quota(property_id="YOUR-GA4-PROPERTY-ID"): property=f"properties/{property_id}", return_property_quota=True, dimensions=[Dimension(name="country")], - metrics=[Metric(name="activeUsers"),], + metrics=[Metric(name="activeUsers")], date_ranges=[DateRange(start_date="7daysAgo", end_date="today")], ) response = client.run_report(request)