From b9ac8d04d6968b7479d430f787af758ac125752e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 9 Nov 2021 16:08:10 -0700 Subject: [PATCH 01/10] chore: use gapic-generator-python 0.56.2 (#49) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update Java and Python dependencies PiperOrigin-RevId: 408420890 Source-Link: https://github.com/googleapis/googleapis/commit/2921f9fb3bfbd16f6b2da0104373e2b47a80a65e Source-Link: https://github.com/googleapis/googleapis-gen/commit/6598ca8cbbf5226733a099c4506518a5af6ff74c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjU5OGNhOGNiYmY1MjI2NzMzYTA5OWM0NTA2NTE4YTVhZjZmZjc0YyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../services/data_fusion/async_client.py | 13 +++-- .../services/data_fusion/client.py | 25 ++++++--- .../services/data_fusion/transports/base.py | 10 ++-- .../services/data_fusion/transports/grpc.py | 6 +- .../data_fusion/transports/grpc_asyncio.py | 6 +- .../gapic/data_fusion_v1/test_data_fusion.py | 56 ++++++++++++++----- 6 files changed, 78 insertions(+), 38 deletions(-) diff --git a/google/cloud/data_fusion_v1/services/data_fusion/async_client.py b/google/cloud/data_fusion_v1/services/data_fusion/async_client.py index e49aec6..f1592e4 100644 --- a/google/cloud/data_fusion_v1/services/data_fusion/async_client.py +++ b/google/cloud/data_fusion_v1/services/data_fusion/async_client.py @@ -19,14 +19,17 @@ from typing import Dict, Sequence, Tuple, Type, Union import pkg_resources -from google.api_core.client_options import ClientOptions # type: ignore -from google.api_core import exceptions as core_exceptions # type: ignore -from google.api_core import gapic_v1 # type: ignore -from google.api_core import retry as retries # type: ignore +from google.api_core.client_options import ClientOptions +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -OptionalRetry = Union[retries.Retry, object] +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore diff --git a/google/cloud/data_fusion_v1/services/data_fusion/client.py b/google/cloud/data_fusion_v1/services/data_fusion/client.py index fbfd514..1183e9e 100644 --- a/google/cloud/data_fusion_v1/services/data_fusion/client.py +++ b/google/cloud/data_fusion_v1/services/data_fusion/client.py @@ -14,23 +14,25 @@ # limitations under the License. # from collections import OrderedDict -from distutils import util import os import re 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 -from google.api_core import exceptions as core_exceptions # type: ignore -from google.api_core import gapic_v1 # type: ignore -from google.api_core import retry as retries # type: ignore +from google.api_core import client_options as client_options_lib +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore -OptionalRetry = Union[retries.Retry, object] +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -289,8 +291,15 @@ def __init__( client_options = client_options_lib.ClientOptions() # Create SSL credentials for mutual TLS if needed. - use_client_cert = bool( - util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false")) + if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in ( + "true", + "false", + ): + raise ValueError( + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + use_client_cert = ( + os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true" ) client_cert_source_func = None diff --git a/google/cloud/data_fusion_v1/services/data_fusion/transports/base.py b/google/cloud/data_fusion_v1/services/data_fusion/transports/base.py index 05abf0a..0332929 100644 --- a/google/cloud/data_fusion_v1/services/data_fusion/transports/base.py +++ b/google/cloud/data_fusion_v1/services/data_fusion/transports/base.py @@ -18,11 +18,11 @@ import pkg_resources import google.auth # type: ignore -import google.api_core # type: ignore -from google.api_core import exceptions as core_exceptions # type: ignore -from google.api_core import gapic_v1 # type: ignore -from google.api_core import retry as retries # type: ignore -from google.api_core import operations_v1 # type: ignore +import google.api_core +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.api_core import operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore diff --git a/google/cloud/data_fusion_v1/services/data_fusion/transports/grpc.py b/google/cloud/data_fusion_v1/services/data_fusion/transports/grpc.py index 43311c6..42304b2 100644 --- a/google/cloud/data_fusion_v1/services/data_fusion/transports/grpc.py +++ b/google/cloud/data_fusion_v1/services/data_fusion/transports/grpc.py @@ -16,9 +16,9 @@ import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union -from google.api_core import grpc_helpers # type: ignore -from google.api_core import operations_v1 # type: ignore -from google.api_core import gapic_v1 # type: ignore +from google.api_core import grpc_helpers +from google.api_core import operations_v1 +from google.api_core import gapic_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore diff --git a/google/cloud/data_fusion_v1/services/data_fusion/transports/grpc_asyncio.py b/google/cloud/data_fusion_v1/services/data_fusion/transports/grpc_asyncio.py index 6ec2391..81d776c 100644 --- a/google/cloud/data_fusion_v1/services/data_fusion/transports/grpc_asyncio.py +++ b/google/cloud/data_fusion_v1/services/data_fusion/transports/grpc_asyncio.py @@ -16,9 +16,9 @@ import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union -from google.api_core import gapic_v1 # type: ignore -from google.api_core import grpc_helpers_async # type: ignore -from google.api_core import operations_v1 # type: ignore +from google.api_core import gapic_v1 +from google.api_core import grpc_helpers_async +from google.api_core import operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore diff --git a/tests/unit/gapic/data_fusion_v1/test_data_fusion.py b/tests/unit/gapic/data_fusion_v1/test_data_fusion.py index e4b9d77..b81020f 100644 --- a/tests/unit/gapic/data_fusion_v1/test_data_fusion.py +++ b/tests/unit/gapic/data_fusion_v1/test_data_fusion.py @@ -634,7 +634,9 @@ def test_list_available_versions_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val def test_list_available_versions_flattened_error(): @@ -670,7 +672,9 @@ async def test_list_available_versions_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val @pytest.mark.asyncio @@ -1471,9 +1475,15 @@ def test_create_instance_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" - assert args[0].instance == datafusion.Instance(name="name_value") - assert args[0].instance_id == "instance_id_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].instance + mock_val = datafusion.Instance(name="name_value") + assert arg == mock_val + arg = args[0].instance_id + mock_val = "instance_id_value" + assert arg == mock_val def test_create_instance_flattened_error(): @@ -1514,9 +1524,15 @@ async def test_create_instance_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].parent == "parent_value" - assert args[0].instance == datafusion.Instance(name="name_value") - assert args[0].instance_id == "instance_id_value" + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].instance + mock_val = datafusion.Instance(name="name_value") + assert arg == mock_val + arg = args[0].instance_id + mock_val = "instance_id_value" + assert arg == mock_val @pytest.mark.asyncio @@ -1679,7 +1695,9 @@ def test_delete_instance_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val def test_delete_instance_flattened_error(): @@ -1713,7 +1731,9 @@ async def test_delete_instance_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val @pytest.mark.asyncio @@ -1880,8 +1900,12 @@ def test_update_instance_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].instance == datafusion.Instance(name="name_value") - assert args[0].update_mask == field_mask_pb2.FieldMask(paths=["paths_value"]) + arg = args[0].instance + mock_val = datafusion.Instance(name="name_value") + assert arg == mock_val + arg = args[0].update_mask + mock_val = field_mask_pb2.FieldMask(paths=["paths_value"]) + assert arg == mock_val def test_update_instance_flattened_error(): @@ -1920,8 +1944,12 @@ async def test_update_instance_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].instance == datafusion.Instance(name="name_value") - assert args[0].update_mask == field_mask_pb2.FieldMask(paths=["paths_value"]) + arg = args[0].instance + mock_val = datafusion.Instance(name="name_value") + assert arg == mock_val + arg = args[0].update_mask + mock_val = field_mask_pb2.FieldMask(paths=["paths_value"]) + assert arg == mock_val @pytest.mark.asyncio From 0b67884a52ca3a33a8d7a7f8f321586061784537 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 11 Nov 2021 13:07:02 -0500 Subject: [PATCH 02/10] chore(python): add .github/CODEOWNERS as a templated file (#50) Source-Link: https://github.com/googleapis/synthtool/commit/c5026b3217973a8db55db8ee85feee0e9a65e295 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:0e18b9475fbeb12d9ad4302283171edebb6baf2dfca1bd215ee3b34ed79d95d7 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .github/CODEOWNERS | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 108063d..7519fa3 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:4ee57a76a176ede9087c14330c625a71553cf9c72828b2c0ca12f5338171ba60 + digest: sha256:0e18b9475fbeb12d9ad4302283171edebb6baf2dfca1bd215ee3b34ed79d95d7 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d08d984..44cc868 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,9 +3,10 @@ # # For syntax help see: # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax +# Note: This file is autogenerated. To make changes to the codeowner team, please update .repo-metadata.json. -# The @googleapis/yoshi-python is the default owner for changes in this repo -* @googleapis/yoshi-python +# @googleapis/yoshi-python is the default owner for changes in this repo +* @googleapis/yoshi-python - -/samples/ @googleapis/python-samples-owners \ No newline at end of file +# @googleapis/python-samples-owners is the default owner for samples changes +/samples/ @googleapis/python-samples-owners From d4a767a4344767e275230df86f1f8bc2cc7c5b59 Mon Sep 17 00:00:00 2001 From: Dan Lee <71398022+dandhlee@users.noreply.github.com> Date: Tue, 16 Nov 2021 11:11:04 -0500 Subject: [PATCH 03/10] chore: update doc links from googleapis.dev to cloud.google.com (#51) --- .repo-metadata.json | 2 +- README.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.repo-metadata.json b/.repo-metadata.json index 552a941..3c9461b 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -2,7 +2,7 @@ "name": "datafusion", "name_pretty": "Cloud Data Fusion", "product_documentation": "https://cloud.google.com/data-fusion", - "client_documentation": "https://googleapis.dev/python/datafusion/latest", + "client_documentation": "https://cloud.google.com/python/docs/reference/datafusion/latest", "issue_tracker": "", "release_level": "ga", "language": "python", diff --git a/README.rst b/README.rst index cbfb900..07bebe6 100644 --- a/README.rst +++ b/README.rst @@ -16,7 +16,7 @@ data from siloed on-premises platforms. .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-data-fusion.svg :target: https://pypi.org/project/google-cloud-data-fusion/ .. _Cloud Data Fusion: https://cloud.google.com/data-fusion -.. _Client Library Documentation: https://googleapis.dev/python/datafusion/latest +.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/datafusion/latest .. _Product Documentation: https://cloud.google.com/data-fusion/docs Quick Start From 35be81c4cf56e673ca0723b4cec33e4c6a17cdad Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Tue, 28 Dec 2021 13:23:15 -0500 Subject: [PATCH 04/10] chore: update .repo-metadata.json (#54) --- .repo-metadata.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.repo-metadata.json b/.repo-metadata.json index 3c9461b..97c48f1 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -4,12 +4,13 @@ "product_documentation": "https://cloud.google.com/data-fusion", "client_documentation": "https://cloud.google.com/python/docs/reference/datafusion/latest", "issue_tracker": "", - "release_level": "ga", + "release_level": "stable", "language": "python", "library_type": "GAPIC_AUTO", "repo": "googleapis/python-data-fusion", "distribution_name": "google-cloud-data-fusion", "api_id": "datafusion.googleapis.com", "default_version": "v1", - "codeowner_team": "" + "codeowner_team": "", + "api_shortname": "datafusion" } From d55498839dc4def17465cb262d47830276af9c61 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 6 Jan 2022 09:07:13 -0700 Subject: [PATCH 05/10] chore: use python-samples-reviewers (#56) Source-Link: https://github.com/googleapis/synthtool/commit/da9308710160980198d85a4bcddac1d6f6f1a5bc Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:899d5d7cc340fa8ef9d8ae1a8cfba362c6898584f779e156f25ee828ba824610 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .github/CODEOWNERS | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 7519fa3..f33299d 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:0e18b9475fbeb12d9ad4302283171edebb6baf2dfca1bd215ee3b34ed79d95d7 + digest: sha256:899d5d7cc340fa8ef9d8ae1a8cfba362c6898584f779e156f25ee828ba824610 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 44cc868..e446644 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -8,5 +8,5 @@ # @googleapis/yoshi-python is the default owner for changes in this repo * @googleapis/yoshi-python -# @googleapis/python-samples-owners is the default owner for samples changes -/samples/ @googleapis/python-samples-owners +# @googleapis/python-samples-reviewers is the default owner for samples changes +/samples/ @googleapis/python-samples-reviewers From c2f5ad74874d9328949b239f7a701c534d25fdad Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 8 Jan 2022 07:01:34 -0500 Subject: [PATCH 06/10] chore: use gapic-generator-python 0.58.4 (#55) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.58.4 fix: provide appropriate mock values for message body fields committer: dovs PiperOrigin-RevId: 419025932 Source-Link: https://github.com/googleapis/googleapis/commit/73da6697f598f1ba30618924936a59f8e457ec89 Source-Link: https://github.com/googleapis/googleapis-gen/commit/46df624a54b9ed47c1a7eefb7a49413cf7b82f98 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDZkZjYyNGE1NGI5ZWQ0N2MxYTdlZWZiN2E0OTQxM2NmN2I4MmY5OCJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../services/data_fusion/transports/base.py | 1 - .../gapic/data_fusion_v1/test_data_fusion.py | 103 +++++++----------- 2 files changed, 39 insertions(+), 65 deletions(-) diff --git a/google/cloud/data_fusion_v1/services/data_fusion/transports/base.py b/google/cloud/data_fusion_v1/services/data_fusion/transports/base.py index 0332929..bc3ff50 100644 --- a/google/cloud/data_fusion_v1/services/data_fusion/transports/base.py +++ b/google/cloud/data_fusion_v1/services/data_fusion/transports/base.py @@ -103,7 +103,6 @@ def __init__( credentials, _ = google.auth.load_credentials_from_file( credentials_file, **scopes_kwargs, quota_project_id=quota_project_id ) - elif credentials is None: credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id diff --git a/tests/unit/gapic/data_fusion_v1/test_data_fusion.py b/tests/unit/gapic/data_fusion_v1/test_data_fusion.py index b81020f..e62e67d 100644 --- a/tests/unit/gapic/data_fusion_v1/test_data_fusion.py +++ b/tests/unit/gapic/data_fusion_v1/test_data_fusion.py @@ -243,20 +243,20 @@ def test_data_fusion_client_client_options( # unsupported value. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): with pytest.raises(MutualTLSChannelError): - client = client_class() + client = client_class(transport=transport_name) # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value. with mock.patch.dict( os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} ): with pytest.raises(ValueError): - client = client_class() + client = client_class(transport=transport_name) # Check the case quota_project_id is provided options = client_options.ClientOptions(quota_project_id="octopus") with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -313,7 +313,7 @@ def test_data_fusion_client_mtls_env_auto( ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) if use_client_cert_env == "false": expected_client_cert_source = None @@ -408,7 +408,7 @@ def test_data_fusion_client_client_options_scopes( options = client_options.ClientOptions(scopes=["1", "2"],) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -439,7 +439,7 @@ def test_data_fusion_client_client_options_credentials_file( options = client_options.ClientOptions(credentials_file="credentials.json") with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file="credentials.json", @@ -470,9 +470,10 @@ def test_data_fusion_client_client_options_from_dict(): ) -def test_list_available_versions( - transport: str = "grpc", request_type=datafusion.ListAvailableVersionsRequest -): +@pytest.mark.parametrize( + "request_type", [datafusion.ListAvailableVersionsRequest, dict,] +) +def test_list_available_versions(request_type, transport: str = "grpc"): client = DataFusionClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -501,10 +502,6 @@ def test_list_available_versions( assert response.next_page_token == "next_page_token_value" -def test_list_available_versions_from_dict(): - test_list_available_versions(request_type=dict) - - def test_list_available_versions_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -689,8 +686,10 @@ async def test_list_available_versions_flattened_error_async(): ) -def test_list_available_versions_pager(): - client = DataFusionClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_available_versions_pager(transport_name: str = "grpc"): + client = DataFusionClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -731,8 +730,10 @@ def test_list_available_versions_pager(): assert all(isinstance(i, datafusion.Version) for i in results) -def test_list_available_versions_pages(): - client = DataFusionClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_available_versions_pages(transport_name: str = "grpc"): + client = DataFusionClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -843,9 +844,8 @@ async def test_list_available_versions_async_pages(): assert page_.raw_page.next_page_token == token -def test_list_instances( - transport: str = "grpc", request_type=datafusion.ListInstancesRequest -): +@pytest.mark.parametrize("request_type", [datafusion.ListInstancesRequest, dict,]) +def test_list_instances(request_type, transport: str = "grpc"): client = DataFusionClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -873,10 +873,6 @@ def test_list_instances( assert response.unreachable == ["unreachable_value"] -def test_list_instances_from_dict(): - test_list_instances(request_type=dict) - - def test_list_instances_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -982,8 +978,10 @@ async def test_list_instances_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_list_instances_pager(): - client = DataFusionClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_instances_pager(transport_name: str = "grpc"): + client = DataFusionClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_instances), "__call__") as call: @@ -1020,8 +1018,10 @@ def test_list_instances_pager(): assert all(isinstance(i, datafusion.Instance) for i in results) -def test_list_instances_pages(): - client = DataFusionClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_instances_pages(transport_name: str = "grpc"): + client = DataFusionClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_instances), "__call__") as call: @@ -1120,9 +1120,8 @@ async def test_list_instances_async_pages(): assert page_.raw_page.next_page_token == token -def test_get_instance( - transport: str = "grpc", request_type=datafusion.GetInstanceRequest -): +@pytest.mark.parametrize("request_type", [datafusion.GetInstanceRequest, dict,]) +def test_get_instance(request_type, transport: str = "grpc"): client = DataFusionClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1185,10 +1184,6 @@ def test_get_instance( assert response.enable_rbac is True -def test_get_instance_from_dict(): - test_get_instance(request_type=dict) - - def test_get_instance_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -1326,9 +1321,8 @@ async def test_get_instance_field_headers_async(): assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] -def test_create_instance( - transport: str = "grpc", request_type=datafusion.CreateInstanceRequest -): +@pytest.mark.parametrize("request_type", [datafusion.CreateInstanceRequest, dict,]) +def test_create_instance(request_type, transport: str = "grpc"): client = DataFusionClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1352,10 +1346,6 @@ def test_create_instance( assert isinstance(response, future.Future) -def test_create_instance_from_dict(): - test_create_instance(request_type=dict) - - def test_create_instance_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -1550,9 +1540,8 @@ async def test_create_instance_flattened_error_async(): ) -def test_delete_instance( - transport: str = "grpc", request_type=datafusion.DeleteInstanceRequest -): +@pytest.mark.parametrize("request_type", [datafusion.DeleteInstanceRequest, dict,]) +def test_delete_instance(request_type, transport: str = "grpc"): client = DataFusionClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1576,10 +1565,6 @@ def test_delete_instance( assert isinstance(response, future.Future) -def test_delete_instance_from_dict(): - test_delete_instance(request_type=dict) - - def test_delete_instance_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -1748,9 +1733,8 @@ async def test_delete_instance_flattened_error_async(): ) -def test_update_instance( - transport: str = "grpc", request_type=datafusion.UpdateInstanceRequest -): +@pytest.mark.parametrize("request_type", [datafusion.UpdateInstanceRequest, dict,]) +def test_update_instance(request_type, transport: str = "grpc"): client = DataFusionClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1774,10 +1758,6 @@ def test_update_instance( assert isinstance(response, future.Future) -def test_update_instance_from_dict(): - test_update_instance(request_type=dict) - - def test_update_instance_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -1966,9 +1946,8 @@ async def test_update_instance_flattened_error_async(): ) -def test_restart_instance( - transport: str = "grpc", request_type=datafusion.RestartInstanceRequest -): +@pytest.mark.parametrize("request_type", [datafusion.RestartInstanceRequest, dict,]) +def test_restart_instance(request_type, transport: str = "grpc"): client = DataFusionClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1992,10 +1971,6 @@ def test_restart_instance( assert isinstance(response, future.Future) -def test_restart_instance_from_dict(): - test_restart_instance(request_type=dict) - - def test_restart_instance_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @@ -2630,7 +2605,7 @@ def test_parse_common_location_path(): assert expected == actual -def test_client_withDEFAULT_CLIENT_INFO(): +def test_client_with_default_client_info(): client_info = gapic_v1.client_info.ClientInfo() with mock.patch.object( From d5320139be38785adf59698cd5d4d941b0d39339 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 13 Jan 2022 16:56:17 -0500 Subject: [PATCH 07/10] build: switch to release-please for tagging (#57) Source-Link: https://github.com/googleapis/synthtool/commit/f8077d237e0df2cb0066dfc6e09fc41e1c59646a Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:dfa9b663b32de8b5b327e32c1da665a80de48876558dd58091d8160c60ad7355 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .github/release-please.yml | 1 + .github/release-trigger.yml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .github/release-trigger.yml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index f33299d..ff5126c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:899d5d7cc340fa8ef9d8ae1a8cfba362c6898584f779e156f25ee828ba824610 + digest: sha256:dfa9b663b32de8b5b327e32c1da665a80de48876558dd58091d8160c60ad7355 diff --git a/.github/release-please.yml b/.github/release-please.yml index 4507ad0..466597e 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1 +1,2 @@ releaseType: python +handleGHRelease: true diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml new file mode 100644 index 0000000..d4ca941 --- /dev/null +++ b/.github/release-trigger.yml @@ -0,0 +1 @@ +enabled: true From 6b38819f26fb72dc67ac2a4dda1c543d91b7f835 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 14 Jan 2022 00:30:13 +0000 Subject: [PATCH 08/10] feat: update definitions for cloud/datafusion/v1 and cloud/datafusion/v1beta1 (#58) fix(v1): multiple fields now have field_behavior REQUIRED fix(v1beta1): multiple fields now have field_behavior REQUIRED - [ ] Regenerate this pull request now. Committer: @viacheslav-rostovtsev PiperOrigin-RevId: 421416031 Source-Link: https://github.com/googleapis/googleapis/commit/5438a17c9bcedf933854df8eb288ab300cc70a1d Source-Link: https://github.com/googleapis/googleapis-gen/commit/cc7213f0c2ac6623c4e8d4ba572337c837990bf5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2M3MjEzZjBjMmFjNjYyM2M0ZThkNGJhNTcyMzM3YzgzNzk5MGJmNSJ9 --- .../services/data_fusion/async_client.py | 31 +++++---- .../services/data_fusion/client.py | 50 ++++++++++---- .../cloud/data_fusion_v1/types/datafusion.py | 59 ++++++++++++---- .../gapic/data_fusion_v1/test_data_fusion.py | 68 ++++++++++++++----- 4 files changed, 152 insertions(+), 56 deletions(-) diff --git a/google/cloud/data_fusion_v1/services/data_fusion/async_client.py b/google/cloud/data_fusion_v1/services/data_fusion/async_client.py index f1592e4..10fc16a 100644 --- a/google/cloud/data_fusion_v1/services/data_fusion/async_client.py +++ b/google/cloud/data_fusion_v1/services/data_fusion/async_client.py @@ -54,6 +54,8 @@ class DataFusionAsyncClient: DEFAULT_ENDPOINT = DataFusionClient.DEFAULT_ENDPOINT DEFAULT_MTLS_ENDPOINT = DataFusionClient.DEFAULT_MTLS_ENDPOINT + crypto_key_path = staticmethod(DataFusionClient.crypto_key_path) + parse_crypto_key_path = staticmethod(DataFusionClient.parse_crypto_key_path) instance_path = staticmethod(DataFusionClient.instance_path) parse_instance_path = staticmethod(DataFusionClient.parse_instance_path) common_billing_account_path = staticmethod( @@ -376,8 +378,8 @@ async def create_instance( The request object. Request message for creating a Data Fusion instance. parent (:class:`str`): - The instance's project and location - in the format + Required. The instance's project and + location in the format projects/{project}/locations/{location}. This corresponds to the ``parent`` field @@ -389,7 +391,9 @@ async def create_instance( on the ``request`` instance; if ``request`` is provided, this should not be set. instance_id (:class:`str`): - The name of the instance to create. + Required. The name of the instance to + create. + This corresponds to the ``instance_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -473,8 +477,8 @@ async def delete_instance( The request object. Request message for deleting a Data Fusion instance. name (:class:`str`): - The instance resource name in the - format + Required. The instance resource name + in the format projects/{project}/locations/{location}/instances/{instance} This corresponds to the ``name`` field @@ -564,14 +568,17 @@ async def update_instance( Args: request (Union[google.cloud.data_fusion_v1.types.UpdateInstanceRequest, dict]): - The request object. + The request object. Request message for updating a Data + Fusion instance. Data Fusion allows updating the labels, + options, and stack driver settings. This is also used + for CDF version upgrade. instance (:class:`google.cloud.data_fusion_v1.types.Instance`): - The instance resource that replaces - the resource on the server. Currently, - Data Fusion only allows replacing - labels, options, and stack driver - settings. All other fields will be - ignored. + Required. The instance resource that + replaces the resource on the server. + Currently, Data Fusion only allows + replacing labels, options, and stack + driver settings. All other fields will + be ignored. This corresponds to the ``instance`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/google/cloud/data_fusion_v1/services/data_fusion/client.py b/google/cloud/data_fusion_v1/services/data_fusion/client.py index 1183e9e..1a1d81d 100644 --- a/google/cloud/data_fusion_v1/services/data_fusion/client.py +++ b/google/cloud/data_fusion_v1/services/data_fusion/client.py @@ -165,6 +165,27 @@ def transport(self) -> DataFusionTransport: """ return self._transport + @staticmethod + def crypto_key_path( + project: str, location: str, key_ring: str, crypto_key: str, + ) -> str: + """Returns a fully-qualified crypto_key string.""" + return "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}".format( + project=project, + location=location, + key_ring=key_ring, + crypto_key=crypto_key, + ) + + @staticmethod + def parse_crypto_key_path(path: str) -> Dict[str, str]: + """Parses a crypto_key path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/keyRings/(?P.+?)/cryptoKeys/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def instance_path(project: str, location: str, instance: str,) -> str: """Returns a fully-qualified instance string.""" @@ -574,8 +595,8 @@ def create_instance( The request object. Request message for creating a Data Fusion instance. parent (str): - The instance's project and location - in the format + Required. The instance's project and + location in the format projects/{project}/locations/{location}. This corresponds to the ``parent`` field @@ -587,7 +608,9 @@ def create_instance( on the ``request`` instance; if ``request`` is provided, this should not be set. instance_id (str): - The name of the instance to create. + Required. The name of the instance to + create. + This corresponds to the ``instance_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -671,8 +694,8 @@ def delete_instance( The request object. Request message for deleting a Data Fusion instance. name (str): - The instance resource name in the - format + Required. The instance resource name + in the format projects/{project}/locations/{location}/instances/{instance} This corresponds to the ``name`` field @@ -762,14 +785,17 @@ def update_instance( Args: request (Union[google.cloud.data_fusion_v1.types.UpdateInstanceRequest, dict]): - The request object. + The request object. Request message for updating a Data + Fusion instance. Data Fusion allows updating the labels, + options, and stack driver settings. This is also used + for CDF version upgrade. instance (google.cloud.data_fusion_v1.types.Instance): - The instance resource that replaces - the resource on the server. Currently, - Data Fusion only allows replacing - labels, options, and stack driver - settings. All other fields will be - ignored. + Required. The instance resource that + replaces the resource on the server. + Currently, Data Fusion only allows + replacing labels, options, and stack + driver settings. All other fields will + be ignored. This corresponds to the ``instance`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/google/cloud/data_fusion_v1/types/datafusion.py b/google/cloud/data_fusion_v1/types/datafusion.py index 1ceaaa0..5dd9edb 100644 --- a/google/cloud/data_fusion_v1/types/datafusion.py +++ b/google/cloud/data_fusion_v1/types/datafusion.py @@ -86,11 +86,23 @@ class Version(proto.Message): available_features (Sequence[str]): Represents a list of available feature names for a given version. + type_ (google.cloud.data_fusion_v1.types.Version.Type): + Type represents the release availability of + the version """ + class Type(proto.Enum): + r"""Each type represents the release availability of a CDF + version + """ + TYPE_UNSPECIFIED = 0 + TYPE_PREVIEW = 1 + TYPE_GENERAL_AVAILABILITY = 2 + version_number = proto.Field(proto.STRING, number=1,) default_version = proto.Field(proto.BOOL, number=2,) available_features = proto.RepeatedField(proto.STRING, number=3,) + type_ = proto.Field(proto.ENUM, number=4, enum=Type,) class Accelerator(proto.Message): @@ -230,6 +242,9 @@ class Instance(proto.Message): The crypto key configuration. This field is used by the Customer-Managed Encryption Keys (CMEK) feature. + disabled_reason (Sequence[google.cloud.data_fusion_v1.types.Instance.DisabledReason]): + Output only. If the instance state is + DISABLED, the reason for disabling the instance. """ class Type(proto.Enum): @@ -253,6 +268,14 @@ class State(proto.Enum): UPDATING = 7 AUTO_UPDATING = 8 AUTO_UPGRADING = 9 + DISABLED = 10 + + class DisabledReason(proto.Enum): + r"""The reason for disabling the instance if the state is + DISABLED. + """ + DISABLED_REASON_UNSPECIFIED = 0 + KMS_KEY_ISSUE = 1 name = proto.Field(proto.STRING, number=1,) description = proto.Field(proto.STRING, number=2,) @@ -289,6 +312,7 @@ class State(proto.Enum): crypto_key_config = proto.Field( proto.MESSAGE, number=28, message="CryptoKeyConfig", ) + disabled_reason = proto.RepeatedField(proto.ENUM, number=29, enum=DisabledReason,) class ListInstancesRequest(proto.Message): @@ -296,8 +320,8 @@ class ListInstancesRequest(proto.Message): Attributes: parent (str): - The project and location for which to - retrieve instance information in the format + Required. The project and location for which + to retrieve instance information in the format projects/{project}/locations/{location}. If the location is specified as '-' (wildcard), then all regions available to the project are @@ -397,7 +421,8 @@ class GetInstanceRequest(proto.Message): Attributes: name (str): - The instance resource name in the format + Required. The instance resource name in the + format projects/{project}/locations/{location}/instances/{instance}. """ @@ -409,10 +434,11 @@ class CreateInstanceRequest(proto.Message): Attributes: parent (str): - The instance's project and location in the - format projects/{project}/locations/{location}. + Required. The instance's project and location + in the format + projects/{project}/locations/{location}. instance_id (str): - The name of the instance to create. + Required. The name of the instance to create. instance (google.cloud.data_fusion_v1.types.Instance): An instance resource. """ @@ -427,7 +453,8 @@ class DeleteInstanceRequest(proto.Message): Attributes: name (str): - The instance resource name in the format + Required. The instance resource name in the + format projects/{project}/locations/{location}/instances/{instance} """ @@ -435,15 +462,17 @@ class DeleteInstanceRequest(proto.Message): class UpdateInstanceRequest(proto.Message): - r""" + r"""Request message for updating a Data Fusion instance. + Data Fusion allows updating the labels, options, and stack + driver settings. This is also used for CDF version upgrade. Attributes: instance (google.cloud.data_fusion_v1.types.Instance): - The instance resource that replaces the - resource on the server. Currently, Data Fusion - only allows replacing labels, options, and stack - driver settings. All other fields will be - ignored. + Required. The instance resource that replaces + the resource on the server. Currently, Data + Fusion only allows replacing labels, options, + and stack driver settings. All other fields will + be ignored. update_mask (google.protobuf.field_mask_pb2.FieldMask): Field mask is used to specify the fields that the update will overwrite in an instance resource. The fields specified @@ -465,8 +494,8 @@ class RestartInstanceRequest(proto.Message): Attributes: name (str): - Name of the Data Fusion instance which need - to be restarted in the form of + Required. Name of the Data Fusion instance + which need to be restarted in the form of projects/{project}/locations/{location}/instances/{instance} """ diff --git a/tests/unit/gapic/data_fusion_v1/test_data_fusion.py b/tests/unit/gapic/data_fusion_v1/test_data_fusion.py index e62e67d..14c9051 100644 --- a/tests/unit/gapic/data_fusion_v1/test_data_fusion.py +++ b/tests/unit/gapic/data_fusion_v1/test_data_fusion.py @@ -1153,6 +1153,7 @@ def test_get_instance(request_type, transport: str = "grpc"): tenant_project_id="tenant_project_id_value", dataproc_service_account="dataproc_service_account_value", enable_rbac=True, + disabled_reason=[datafusion.Instance.DisabledReason.KMS_KEY_ISSUE], ) response = client.get_instance(request) @@ -1182,6 +1183,9 @@ def test_get_instance(request_type, transport: str = "grpc"): assert response.tenant_project_id == "tenant_project_id_value" assert response.dataproc_service_account == "dataproc_service_account_value" assert response.enable_rbac is True + assert response.disabled_reason == [ + datafusion.Instance.DisabledReason.KMS_KEY_ISSUE + ] def test_get_instance_empty_call(): @@ -1235,6 +1239,7 @@ async def test_get_instance_async( tenant_project_id="tenant_project_id_value", dataproc_service_account="dataproc_service_account_value", enable_rbac=True, + disabled_reason=[datafusion.Instance.DisabledReason.KMS_KEY_ISSUE], ) ) response = await client.get_instance(request) @@ -1265,6 +1270,9 @@ async def test_get_instance_async( assert response.tenant_project_id == "tenant_project_id_value" assert response.dataproc_service_account == "dataproc_service_account_value" assert response.enable_rbac is True + assert response.disabled_reason == [ + datafusion.Instance.DisabledReason.KMS_KEY_ISSUE + ] @pytest.mark.asyncio @@ -2485,10 +2493,36 @@ def test_data_fusion_grpc_lro_async_client(): assert transport.operations_client is transport.operations_client -def test_instance_path(): +def test_crypto_key_path(): project = "squid" location = "clam" - instance = "whelk" + key_ring = "whelk" + crypto_key = "octopus" + expected = "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}".format( + project=project, location=location, key_ring=key_ring, crypto_key=crypto_key, + ) + actual = DataFusionClient.crypto_key_path(project, location, key_ring, crypto_key) + assert expected == actual + + +def test_parse_crypto_key_path(): + expected = { + "project": "oyster", + "location": "nudibranch", + "key_ring": "cuttlefish", + "crypto_key": "mussel", + } + path = DataFusionClient.crypto_key_path(**expected) + + # Check that the path construction is reversible. + actual = DataFusionClient.parse_crypto_key_path(path) + assert expected == actual + + +def test_instance_path(): + project = "winkle" + location = "nautilus" + instance = "scallop" expected = "projects/{project}/locations/{location}/instances/{instance}".format( project=project, location=location, instance=instance, ) @@ -2498,9 +2532,9 @@ def test_instance_path(): def test_parse_instance_path(): expected = { - "project": "octopus", - "location": "oyster", - "instance": "nudibranch", + "project": "abalone", + "location": "squid", + "instance": "clam", } path = DataFusionClient.instance_path(**expected) @@ -2510,7 +2544,7 @@ def test_parse_instance_path(): def test_common_billing_account_path(): - billing_account = "cuttlefish" + billing_account = "whelk" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -2520,7 +2554,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "mussel", + "billing_account": "octopus", } path = DataFusionClient.common_billing_account_path(**expected) @@ -2530,7 +2564,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "winkle" + folder = "oyster" expected = "folders/{folder}".format(folder=folder,) actual = DataFusionClient.common_folder_path(folder) assert expected == actual @@ -2538,7 +2572,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "nautilus", + "folder": "nudibranch", } path = DataFusionClient.common_folder_path(**expected) @@ -2548,7 +2582,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "scallop" + organization = "cuttlefish" expected = "organizations/{organization}".format(organization=organization,) actual = DataFusionClient.common_organization_path(organization) assert expected == actual @@ -2556,7 +2590,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "abalone", + "organization": "mussel", } path = DataFusionClient.common_organization_path(**expected) @@ -2566,7 +2600,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "squid" + project = "winkle" expected = "projects/{project}".format(project=project,) actual = DataFusionClient.common_project_path(project) assert expected == actual @@ -2574,7 +2608,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "clam", + "project": "nautilus", } path = DataFusionClient.common_project_path(**expected) @@ -2584,8 +2618,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "whelk" - location = "octopus" + project = "scallop" + location = "abalone" expected = "projects/{project}/locations/{location}".format( project=project, location=location, ) @@ -2595,8 +2629,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "oyster", - "location": "nudibranch", + "project": "squid", + "location": "clam", } path = DataFusionClient.common_location_path(**expected) From 2480bf53448b89ac5d27c50d23d464a4ee3241c8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 14 Jan 2022 10:06:18 -0500 Subject: [PATCH 09/10] chore(python): update release.sh to use keystore (#60) Source-Link: https://github.com/googleapis/synthtool/commit/69fda12e2994f0b595a397e8bb6e3e9f380524eb Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ae600f36b6bc972b368367b6f83a1d91ec2c82a4a116b383d67d547c56fe6de3 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/release.sh | 2 +- .kokoro/release/common.cfg | 12 +++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index ff5126c..eecb84c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:dfa9b663b32de8b5b327e32c1da665a80de48876558dd58091d8160c60ad7355 + digest: sha256:ae600f36b6bc972b368367b6f83a1d91ec2c82a4a116b383d67d547c56fe6de3 diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 53777f0..3179064 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -26,7 +26,7 @@ python3 -m pip install --upgrade twine wheel setuptools export PYTHONUNBUFFERED=1 # Move into the package, build the distribution and upload. -TWINE_PASSWORD=$(cat "${KOKORO_GFILE_DIR}/secret_manager/google-cloud-pypi-token") +TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1") cd github/python-data-fusion python3 setup.py sdist bdist_wheel twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index 00438df..13cca2a 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -23,8 +23,18 @@ env_vars: { value: "github/python-data-fusion/.kokoro/release.sh" } +# Fetch PyPI password +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "google-cloud-pypi-token-keystore-1" + } + } +} + # Tokens needed to report release status back to GitHub env_vars: { key: "SECRET_MANAGER_KEYS" - value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem,google-cloud-pypi-token" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" } From cdc2d510bca87bda0599f4081f54a41aa23006ad Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 18 Jan 2022 08:58:57 -0700 Subject: [PATCH 10/10] chore(main): release 1.3.0 (#59) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3254c25..5d08eeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.3.0](https://github.com/googleapis/python-data-fusion/compare/v1.2.1...v1.3.0) (2022-01-14) + + +### Features + +* update definitions for cloud/datafusion/v1 and cloud/datafusion/v1beta1 ([#58](https://github.com/googleapis/python-data-fusion/issues/58)) ([6b38819](https://github.com/googleapis/python-data-fusion/commit/6b38819f26fb72dc67ac2a4dda1c543d91b7f835)) + ### [1.2.1](https://www.github.com/googleapis/python-data-fusion/compare/v1.2.0...v1.2.1) (2021-11-01) diff --git a/setup.py b/setup.py index 700fb44..c896879 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ name = "google-cloud-data-fusion" description = "Cloud Data Fusion API client library" -version = "1.2.1" +version = "1.3.0" release_status = "Development Status :: 5 - Production/Stable" url = "https://github.com/googleapis/python-data-fusion" dependencies = [