diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9ee60f7..ee94722 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: - image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:aea14a583128771ae8aefa364e1652f3c56070168ef31beb203534222d842b8b + image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest + digest: sha256:6e7328583be8edd3ba8f35311c76a1ecbc823010279ccb6ab46b7a76e25eafcc diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml index fe092d4..fc936be 100644 --- a/.github/.OwlBot.yaml +++ b/.github/.OwlBot.yaml @@ -13,7 +13,7 @@ # limitations under the License. docker: - image: gcr.io/repo-automation-bots/owlbot-python:latest + image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest deep-remove-regex: - /owl-bot-staging diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ae570eb..1473ae0 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -8,4 +8,4 @@ * @googleapis/api-bigquery @googleapis/yoshi-python # The python-samples-reviewers team is the default owner for samples changes -/samples/ @googleapis/python-samples-owners +/samples/ @googleapis/python-samples-owners @googleapis/api-bigquery @googleapis/yoshi-python diff --git a/.kokoro/build.sh b/.kokoro/build.sh index c9f2ecc..3cf685b 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -41,7 +41,7 @@ python3 -m pip install --upgrade --quiet nox python3 -m nox --version # If this is a continuous build, send the test log to the FlakyBot. -# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot. +# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot. if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then cleanup() { chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot diff --git a/.kokoro/samples/lint/common.cfg b/.kokoro/samples/lint/common.cfg index 4ce999a..e326a60 100644 --- a/.kokoro/samples/lint/common.cfg +++ b/.kokoro/samples/lint/common.cfg @@ -31,4 +31,4 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "python-bigquery-connection/.kokoro/trampoline.sh" \ No newline at end of file +build_file: "python-bigquery-connection/.kokoro/trampoline_v2.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.6/common.cfg b/.kokoro/samples/python3.6/common.cfg index 8c283c8..345cca3 100644 --- a/.kokoro/samples/python3.6/common.cfg +++ b/.kokoro/samples/python3.6/common.cfg @@ -37,4 +37,4 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "python-bigquery-connection/.kokoro/trampoline.sh" \ No newline at end of file +build_file: "python-bigquery-connection/.kokoro/trampoline_v2.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.6/periodic.cfg b/.kokoro/samples/python3.6/periodic.cfg index 50fec96..71cd1e5 100644 --- a/.kokoro/samples/python3.6/periodic.cfg +++ b/.kokoro/samples/python3.6/periodic.cfg @@ -3,4 +3,4 @@ env_vars: { key: "INSTALL_LIBRARY_FROM_SOURCE" value: "False" -} \ No newline at end of file +} diff --git a/.kokoro/samples/python3.7/common.cfg b/.kokoro/samples/python3.7/common.cfg index 690d232..7ee59c8 100644 --- a/.kokoro/samples/python3.7/common.cfg +++ b/.kokoro/samples/python3.7/common.cfg @@ -37,4 +37,4 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "python-bigquery-connection/.kokoro/trampoline.sh" \ No newline at end of file +build_file: "python-bigquery-connection/.kokoro/trampoline_v2.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.7/periodic.cfg b/.kokoro/samples/python3.7/periodic.cfg index 50fec96..71cd1e5 100644 --- a/.kokoro/samples/python3.7/periodic.cfg +++ b/.kokoro/samples/python3.7/periodic.cfg @@ -3,4 +3,4 @@ env_vars: { key: "INSTALL_LIBRARY_FROM_SOURCE" value: "False" -} \ No newline at end of file +} diff --git a/.kokoro/samples/python3.8/common.cfg b/.kokoro/samples/python3.8/common.cfg index 126f9e4..fb39657 100644 --- a/.kokoro/samples/python3.8/common.cfg +++ b/.kokoro/samples/python3.8/common.cfg @@ -37,4 +37,4 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "python-bigquery-connection/.kokoro/trampoline.sh" \ No newline at end of file +build_file: "python-bigquery-connection/.kokoro/trampoline_v2.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.8/periodic.cfg b/.kokoro/samples/python3.8/periodic.cfg index 50fec96..71cd1e5 100644 --- a/.kokoro/samples/python3.8/periodic.cfg +++ b/.kokoro/samples/python3.8/periodic.cfg @@ -3,4 +3,4 @@ env_vars: { key: "INSTALL_LIBRARY_FROM_SOURCE" value: "False" -} \ No newline at end of file +} diff --git a/.kokoro/samples/python3.9/common.cfg b/.kokoro/samples/python3.9/common.cfg index e8dc291..71a3b6b 100644 --- a/.kokoro/samples/python3.9/common.cfg +++ b/.kokoro/samples/python3.9/common.cfg @@ -37,4 +37,4 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "python-bigquery-connection/.kokoro/trampoline.sh" \ No newline at end of file +build_file: "python-bigquery-connection/.kokoro/trampoline_v2.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.9/periodic.cfg b/.kokoro/samples/python3.9/periodic.cfg index 50fec96..71cd1e5 100644 --- a/.kokoro/samples/python3.9/periodic.cfg +++ b/.kokoro/samples/python3.9/periodic.cfg @@ -3,4 +3,4 @@ env_vars: { key: "INSTALL_LIBRARY_FROM_SOURCE" value: "False" -} \ No newline at end of file +} diff --git a/.kokoro/test-samples-against-head.sh b/.kokoro/test-samples-against-head.sh index 3acd37f..ba3a707 100755 --- a/.kokoro/test-samples-against-head.sh +++ b/.kokoro/test-samples-against-head.sh @@ -23,6 +23,4 @@ set -eo pipefail # Enables `**` to include files nested inside sub-folders shopt -s globstar -cd github/python-bigquery-connection - exec .kokoro/test-samples-impl.sh diff --git a/.kokoro/test-samples-impl.sh b/.kokoro/test-samples-impl.sh index 311a8d5..8a324c9 100755 --- a/.kokoro/test-samples-impl.sh +++ b/.kokoro/test-samples-impl.sh @@ -80,7 +80,7 @@ for file in samples/**/requirements.txt; do EXIT=$? # If this is a periodic build, send the test log to the FlakyBot. - # See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot. + # See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot. if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot $KOKORO_GFILE_DIR/linux_amd64/flakybot diff --git a/.kokoro/test-samples.sh b/.kokoro/test-samples.sh index 1c88307..11c042d 100755 --- a/.kokoro/test-samples.sh +++ b/.kokoro/test-samples.sh @@ -24,8 +24,6 @@ set -eo pipefail # Enables `**` to include files nested inside sub-folders shopt -s globstar -cd github/python-bigquery-connection - # Run periodic samples tests at latest release if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then # preserving the test runner implementation. diff --git a/.repo-metadata.json b/.repo-metadata.json index 20a417c..263c377 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -1,14 +1,16 @@ { -"name": "bigqueryconnection", -"name_pretty": "Google BigQuery Connection", -"product_documentation": "https://cloud.google.com/bigquery/docs/reference/bigqueryconnection", -"client_documentation": "https://googleapis.dev/python/bigqueryconnection/latest", -"issue_tracker": "", -"release_level": "ga", -"language": "python", -"library_type": "GAPIC_AUTO", -"repo": "googleapis/python-bigquery-connection", -"distribution_name": "google-cloud-bigquery-connection", -"api_id": "bigqueryconnection.googleapis.com", -"requires_billing": true -} \ No newline at end of file + "name": "bigqueryconnection", + "name_pretty": "Google BigQuery Connection", + "product_documentation": "https://cloud.google.com/bigquery/docs/reference/bigqueryconnection", + "client_documentation": "https://googleapis.dev/python/bigqueryconnection/latest", + "issue_tracker": "", + "release_level": "ga", + "language": "python", + "library_type": "GAPIC_AUTO", + "repo": "googleapis/python-bigquery-connection", + "distribution_name": "google-cloud-bigquery-connection", + "api_id": "bigqueryconnection.googleapis.com", + "requires_billing": true, + "default_version": "v1", + "codeowner_team": "@googleapis/api-bigquery" +} diff --git a/.trampolinerc b/.trampolinerc index 383b6ec..0eee72a 100644 --- a/.trampolinerc +++ b/.trampolinerc @@ -16,15 +16,26 @@ # Add required env vars here. required_envvars+=( - "STAGING_BUCKET" - "V2_STAGING_BUCKET" ) # Add env vars which are passed down into the container here. pass_down_envvars+=( + "NOX_SESSION" + ############### + # Docs builds + ############### "STAGING_BUCKET" "V2_STAGING_BUCKET" - "NOX_SESSION" + ################## + # Samples builds + ################## + "INSTALL_LIBRARY_FROM_SOURCE" + "RUN_TESTS_SESSION" + "BUILD_SPECIFIC_GCLOUD_PROJECT" + # Target directories. + "RUN_TESTS_DIRS" + # The nox session to run. + "RUN_TESTS_SESSION" ) # Prevent unintentional override on the default image. diff --git a/CHANGELOG.md b/CHANGELOG.md index e9e6c71..cf21a0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [1.2.3](https://www.github.com/googleapis/python-bigquery-connection/compare/v1.2.2...v1.2.3) (2021-10-05) + + +### Bug Fixes + +* add 'dict' annotation type to 'request' ([87b77ee](https://www.github.com/googleapis/python-bigquery-connection/commit/87b77ee76e3abcce5428230a6884c66843353440)) +* improper types in pagers generation ([47d1b68](https://www.github.com/googleapis/python-bigquery-connection/commit/47d1b68b74dda036b64979e4c7aab589046822ba)) + ### [1.2.2](https://www.github.com/googleapis/python-bigquery-connection/compare/v1.2.1...v1.2.2) (2021-07-27) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 3400835..fee1f58 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -50,9 +50,9 @@ You'll have to create a development environment using a Git checkout: # Configure remotes such that you can pull changes from the googleapis/python-bigquery-connection # repository into your local repository. $ git remote add upstream git@github.com:googleapis/python-bigquery-connection.git - # fetch and merge changes from upstream into master + # fetch and merge changes from upstream into main $ git fetch upstream - $ git merge upstream/master + $ git merge upstream/main Now your local repo is set up such that you will push changes to your GitHub repo, from which you can submit a pull request. @@ -110,12 +110,12 @@ Coding Style variables:: export GOOGLE_CLOUD_TESTING_REMOTE="upstream" - export GOOGLE_CLOUD_TESTING_BRANCH="master" + export GOOGLE_CLOUD_TESTING_BRANCH="main" By doing this, you are specifying the location of the most up-to-date - version of ``python-bigquery-connection``. The the suggested remote name ``upstream`` - should point to the official ``googleapis`` checkout and the - the branch should be the main branch on that remote (``master``). + version of ``python-bigquery-connection``. The + remote name ``upstream`` should point to the official ``googleapis`` + checkout and the branch should be the default branch on that remote (``main``). - This repository contains configuration for the `pre-commit `__ tool, which automates checking @@ -209,7 +209,7 @@ The `description on PyPI`_ for the project comes directly from the ``README``. Due to the reStructuredText (``rst``) parser used by PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst`` instead of -``https://github.com/googleapis/python-bigquery-connection/blob/master/CONTRIBUTING.rst``) +``https://github.com/googleapis/python-bigquery-connection/blob/main/CONTRIBUTING.rst``) may cause problems creating links or rendering the description. .. _description on PyPI: https://pypi.org/project/google-cloud-bigquery-connection @@ -234,7 +234,7 @@ We support: Supported versions can be found in our ``noxfile.py`` `config`_. -.. _config: https://github.com/googleapis/python-bigquery-connection/blob/master/noxfile.py +.. _config: https://github.com/googleapis/python-bigquery-connection/blob/main/noxfile.py We also explicitly decided to support Python 3 beginning with version 3.6. diff --git a/README.rst b/README.rst index 3fb2804..74da0b2 100644 --- a/README.rst +++ b/README.rst @@ -10,7 +10,7 @@ Python Client for BigQuery Connection - `Introduction to BigQuery external data sources`_ .. |GA| image:: https://img.shields.io/badge/support-ga-gold.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#general-availability + :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#general-availability .. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-bigquery-connection.svg :target: https://pypi.org/project/google-cloud-bigquery-connection/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-bigquery-connection.svg @@ -81,4 +81,4 @@ Next Steps APIs that we cover. .. _BigQuery Connection API Product documentation: https://cloud.google.com/bigquery/docs/reference/bigqueryconnection/rest -.. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst \ No newline at end of file +.. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 49ed01d..4a15e89 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -76,8 +76,8 @@ # The encoding of source files. # source_encoding = 'utf-8-sig' -# The master toctree document. -master_doc = "index" +# The root toctree document. +root_doc = "index" # General information about the project. project = "google-cloud-bigquery-connection" @@ -110,6 +110,7 @@ # directories to ignore when looking for source files. exclude_patterns = [ "_build", + "**/.nox/**/*", "samples/AUTHORING_GUIDE.md", "samples/CONTRIBUTING.md", "samples/snippets/README.rst", @@ -279,7 +280,7 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ ( - master_doc, + root_doc, "google-cloud-bigquery-connection.tex", "google-cloud-bigquery-connection Documentation", author, @@ -314,7 +315,7 @@ # (source start file, name, description, authors, manual section). man_pages = [ ( - master_doc, + root_doc, "google-cloud-bigquery-connection", "google-cloud-bigquery-connection Documentation", [author], @@ -333,7 +334,7 @@ # dir menu entry, description, category) texinfo_documents = [ ( - master_doc, + root_doc, "google-cloud-bigquery-connection", "google-cloud-bigquery-connection Documentation", author, diff --git a/google/cloud/bigquery_connection_v1/services/connection_service/client.py b/google/cloud/bigquery_connection_v1/services/connection_service/client.py index 0f818a7..61dec54 100644 --- a/google/cloud/bigquery_connection_v1/services/connection_service/client.py +++ b/google/cloud/bigquery_connection_v1/services/connection_service/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore @@ -358,7 +358,7 @@ def __init__( def create_connection( self, - request: gcbc_connection.CreateConnectionRequest = None, + request: Union[gcbc_connection.CreateConnectionRequest, dict] = None, *, parent: str = None, connection: gcbc_connection.Connection = None, @@ -370,7 +370,7 @@ def create_connection( r"""Creates a new connection. Args: - request (google.cloud.bigquery_connection_v1.types.CreateConnectionRequest): + request (Union[google.cloud.bigquery_connection_v1.types.CreateConnectionRequest, dict]): The request object. The request for [ConnectionService.CreateConnection][google.cloud.bigquery.connection.v1.ConnectionService.CreateConnection]. parent (str): @@ -448,7 +448,7 @@ def create_connection( def get_connection( self, - request: connection.GetConnectionRequest = None, + request: Union[connection.GetConnectionRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -458,7 +458,7 @@ def get_connection( r"""Returns specified connection. Args: - request (google.cloud.bigquery_connection_v1.types.GetConnectionRequest): + request (Union[google.cloud.bigquery_connection_v1.types.GetConnectionRequest, dict]): The request object. The request for [ConnectionService.GetConnection][google.cloud.bigquery.connection.v1.ConnectionService.GetConnection]. name (str): @@ -520,7 +520,7 @@ def get_connection( def list_connections( self, - request: connection.ListConnectionsRequest = None, + request: Union[connection.ListConnectionsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -530,7 +530,7 @@ def list_connections( r"""Returns a list of connections in the given project. Args: - request (google.cloud.bigquery_connection_v1.types.ListConnectionsRequest): + request (Union[google.cloud.bigquery_connection_v1.types.ListConnectionsRequest, dict]): The request object. The request for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections]. parent (str): @@ -600,7 +600,7 @@ def list_connections( def update_connection( self, - request: gcbc_connection.UpdateConnectionRequest = None, + request: Union[gcbc_connection.UpdateConnectionRequest, dict] = None, *, name: str = None, connection: gcbc_connection.Connection = None, @@ -614,7 +614,7 @@ def update_connection( are in the update field mask. Args: - request (google.cloud.bigquery_connection_v1.types.UpdateConnectionRequest): + request (Union[google.cloud.bigquery_connection_v1.types.UpdateConnectionRequest, dict]): The request object. The request for [ConnectionService.UpdateConnection][google.cloud.bigquery.connection.v1.ConnectionService.UpdateConnection]. name (str): @@ -694,7 +694,7 @@ def update_connection( def delete_connection( self, - request: connection.DeleteConnectionRequest = None, + request: Union[connection.DeleteConnectionRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -704,7 +704,7 @@ def delete_connection( r"""Deletes connection and associated credential. Args: - request (google.cloud.bigquery_connection_v1.types.DeleteConnectionRequest): + request (Union[google.cloud.bigquery_connection_v1.types.DeleteConnectionRequest, dict]): The request object. The request for [ConnectionService.DeleteConnectionRequest][]. name (str): @@ -758,7 +758,7 @@ def delete_connection( def get_iam_policy( self, - request: iam_policy_pb2.GetIamPolicyRequest = None, + request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, *, resource: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -770,7 +770,7 @@ def get_iam_policy( not have a policy set. Args: - request (google.iam.v1.iam_policy_pb2.GetIamPolicyRequest): + request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): The request object. Request message for `GetIamPolicy` method. resource (str): @@ -885,7 +885,7 @@ def get_iam_policy( def set_iam_policy( self, - request: iam_policy_pb2.SetIamPolicyRequest = None, + request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, *, resource: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -899,7 +899,7 @@ def set_iam_policy( ``PERMISSION_DENIED`` errors. Args: - request (google.iam.v1.iam_policy_pb2.SetIamPolicyRequest): + request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): The request object. Request message for `SetIamPolicy` method. resource (str): @@ -1014,7 +1014,7 @@ def set_iam_policy( def test_iam_permissions( self, - request: iam_policy_pb2.TestIamPermissionsRequest = None, + request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, *, resource: str = None, permissions: Sequence[str] = None, @@ -1032,7 +1032,7 @@ def test_iam_permissions( warning. Args: - request (google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest): + request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): The request object. Request message for `TestIamPermissions` method. resource (str): diff --git a/google/cloud/bigquery_connection_v1/services/connection_service/pagers.py b/google/cloud/bigquery_connection_v1/services/connection_service/pagers.py index 9706379..709d723 100644 --- a/google/cloud/bigquery_connection_v1/services/connection_service/pagers.py +++ b/google/cloud/bigquery_connection_v1/services/connection_service/pagers.py @@ -15,13 +15,13 @@ # from typing import ( Any, - AsyncIterable, + AsyncIterator, Awaitable, Callable, - Iterable, Sequence, Tuple, Optional, + Iterator, ) from google.cloud.bigquery_connection_v1.types import connection @@ -74,14 +74,14 @@ def __getattr__(self, name: str) -> Any: return getattr(self._response, name) @property - def pages(self) -> Iterable[connection.ListConnectionsResponse]: + def pages(self) -> Iterator[connection.ListConnectionsResponse]: yield self._response while self._response.next_page_token: self._request.page_token = self._response.next_page_token self._response = self._method(self._request, metadata=self._metadata) yield self._response - def __iter__(self) -> Iterable[connection.Connection]: + def __iter__(self) -> Iterator[connection.Connection]: for page in self.pages: yield from page.connections @@ -136,14 +136,14 @@ def __getattr__(self, name: str) -> Any: return getattr(self._response, name) @property - async def pages(self) -> AsyncIterable[connection.ListConnectionsResponse]: + async def pages(self) -> AsyncIterator[connection.ListConnectionsResponse]: yield self._response while self._response.next_page_token: self._request.page_token = self._response.next_page_token self._response = await self._method(self._request, metadata=self._metadata) yield self._response - def __aiter__(self) -> AsyncIterable[connection.Connection]: + def __aiter__(self) -> AsyncIterator[connection.Connection]: async def async_generator(): async for page in self.pages: for response in page.connections: diff --git a/google/cloud/bigquery_connection_v1/services/connection_service/transports/base.py b/google/cloud/bigquery_connection_v1/services/connection_service/transports/base.py index 8cd1907..7f5c9be 100644 --- a/google/cloud/bigquery_connection_v1/services/connection_service/transports/base.py +++ b/google/cloud/bigquery_connection_v1/services/connection_service/transports/base.py @@ -124,7 +124,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/bigquery_connection_v1/services/connection_service/transports/grpc.py b/google/cloud/bigquery_connection_v1/services/connection_service/transports/grpc.py index d682bbe..1724f74 100644 --- a/google/cloud/bigquery_connection_v1/services/connection_service/transports/grpc.py +++ b/google/cloud/bigquery_connection_v1/services/connection_service/transports/grpc.py @@ -84,16 +84,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/bigquery_connection_v1/services/connection_service/transports/grpc_asyncio.py b/google/cloud/bigquery_connection_v1/services/connection_service/transports/grpc_asyncio.py index 30c794e..20d3be2 100644 --- a/google/cloud/bigquery_connection_v1/services/connection_service/transports/grpc_asyncio.py +++ b/google/cloud/bigquery_connection_v1/services/connection_service/transports/grpc_asyncio.py @@ -131,16 +131,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/noxfile.py b/noxfile.py index 94ee6a8..93ea9b1 100644 --- a/noxfile.py +++ b/noxfile.py @@ -84,9 +84,15 @@ def default(session): constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) - session.install("asyncmock", "pytest-asyncio", "-c", constraints_path) - - session.install("mock", "pytest", "pytest-cov", "-c", constraints_path) + session.install( + "mock", + "asyncmock", + "pytest", + "pytest-cov", + "pytest-asyncio", + "-c", + constraints_path, + ) session.install("-e", ".", "-c", constraints_path) diff --git a/owlbot.py b/owlbot.py index 532c73a..d13854b 100644 --- a/owlbot.py +++ b/owlbot.py @@ -31,12 +31,54 @@ # ---------------------------------------------------------------------------- # Add templated files # ---------------------------------------------------------------------------- -templated_files = common.py_library( - cov_level=99, - microgenerator=True, -) +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 +# Remove the replacements below once https://github.com/googleapis/synthtool/pull/1188 is merged + +# Update googleapis/repo-automation-bots repo to main in .kokoro/*.sh files +s.replace( + ".kokoro/*.sh", "repo-automation-bots/tree/master", "repo-automation-bots/tree/main" +) + +# Customize CONTRIBUTING.rst to replace master with main +s.replace( + "CONTRIBUTING.rst", + "fetch and merge changes from upstream into master", + "fetch and merge changes from upstream into main", +) + +s.replace( + "CONTRIBUTING.rst", "git merge upstream/master", "git merge upstream/main", +) + +s.replace( + "CONTRIBUTING.rst", + """export GOOGLE_CLOUD_TESTING_BRANCH=\"master\"""", + """export GOOGLE_CLOUD_TESTING_BRANCH=\"main\"""", +) + +s.replace( + "CONTRIBUTING.rst", "remote \(``master``\)", "remote (``main``)", +) + +s.replace( + "CONTRIBUTING.rst", "blob/master/CONTRIBUTING.rst", "blob/main/CONTRIBUTING.rst", +) + +s.replace( + "CONTRIBUTING.rst", "blob/master/noxfile.py", "blob/main/noxfile.py", +) + +s.replace( + "docs/conf.py", "master_doc", "root_doc", +) + +s.replace( + "docs/conf.py", "# The master toctree document.", "# The root toctree document.", +) + s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/renovate.json b/renovate.json index c048955..c21036d 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,9 @@ { "extends": [ - "config:base", ":preserveSemverRanges" + "config:base", + "group:all", + ":preserveSemverRanges", + ":disableDependencyDashboard" ], "ignorePaths": [".pre-commit-config.yaml"], "pip_requirements": { diff --git a/scripts/fixup_bigquery_connection_v1_keywords.py b/scripts/fixup_bigquery_connection_v1_keywords.py index 9276ace..8693120 100644 --- a/scripts/fixup_bigquery_connection_v1_keywords.py +++ b/scripts/fixup_bigquery_connection_v1_keywords.py @@ -39,14 +39,14 @@ def partition( class bigquery_connectionCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'create_connection': ('parent', 'connection', 'connection_id', ), - 'delete_connection': ('name', ), - 'get_connection': ('name', ), - 'get_iam_policy': ('resource', 'options', ), - 'list_connections': ('parent', 'page_size', 'page_token', ), - 'set_iam_policy': ('resource', 'policy', ), - 'test_iam_permissions': ('resource', 'permissions', ), - 'update_connection': ('name', 'connection', 'update_mask', ), + 'create_connection': ('parent', 'connection', 'connection_id', ), + 'delete_connection': ('name', ), + 'get_connection': ('name', ), + 'get_iam_policy': ('resource', 'options', ), + 'list_connections': ('parent', 'page_size', 'page_token', ), + 'set_iam_policy': ('resource', 'policy', ), + 'test_iam_permissions': ('resource', 'permissions', ), + 'update_connection': ('name', 'connection', 'update_mask', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -65,7 +65,7 @@ def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: return updated kwargs, ctrl_kwargs = partition( - lambda a: not a.keyword.value in self.CTRL_PARAMS, + lambda a: a.keyword.value not in self.CTRL_PARAMS, kwargs ) diff --git a/scripts/readme-gen/templates/install_deps.tmpl.rst b/scripts/readme-gen/templates/install_deps.tmpl.rst index a0406db..275d649 100644 --- a/scripts/readme-gen/templates/install_deps.tmpl.rst +++ b/scripts/readme-gen/templates/install_deps.tmpl.rst @@ -12,7 +12,7 @@ Install Dependencies .. _Python Development Environment Setup Guide: https://cloud.google.com/python/setup -#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. +#. Create a virtualenv. Samples are compatible with Python 3.6+. .. code-block:: bash diff --git a/setup.py b/setup.py index d110498..e8a4921 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ import os import setuptools # type: ignore -version = "1.2.2" +version = "1.2.3" package_root = os.path.abspath(os.path.dirname(__file__))