From 054f53748efa86f96da008a43bba2c2cf8948ffe Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Wed, 3 Nov 2021 10:43:40 -0400 Subject: [PATCH] fix: suppress type error for fallback def of OptionalRetry Introduced in #1032. --- .../%name/%version/%sub/services/%service/client.py.j2 | 2 +- .../%name_%version/%sub/services/%service/async_client.py.j2 | 2 +- .../%name_%version/%sub/services/%service/client.py.j2 | 2 +- .../%name_%version/%sub/services/%service/transports/rest.py.j2 | 2 +- .../cloud/asset_v1/services/asset_service/async_client.py | 2 +- .../google/cloud/asset_v1/services/asset_service/client.py | 2 +- .../iam/credentials_v1/services/iam_credentials/async_client.py | 2 +- .../iam/credentials_v1/services/iam_credentials/client.py | 2 +- .../cloud/logging_v2/services/config_service_v2/async_client.py | 2 +- .../cloud/logging_v2/services/config_service_v2/client.py | 2 +- .../logging_v2/services/logging_service_v2/async_client.py | 2 +- .../cloud/logging_v2/services/logging_service_v2/client.py | 2 +- .../logging_v2/services/metrics_service_v2/async_client.py | 2 +- .../cloud/logging_v2/services/metrics_service_v2/client.py | 2 +- .../google/cloud/redis_v1/services/cloud_redis/async_client.py | 2 +- .../redis/google/cloud/redis_v1/services/cloud_redis/client.py | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2 b/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2 index 6d1d137054..c224020367 100644 --- a/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2 +++ b/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2 @@ -25,7 +25,7 @@ from google.oauth2 import service_account # type: ignore try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + OptionalRetry = Union[retries.Retry, object] # type: ignore {% filter sort_lines %} {% for method in service.methods.values() %} diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 index baeea6118b..a6804be3b6 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 @@ -21,7 +21,7 @@ from google.oauth2 import service_account # type: ignore try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + OptionalRetry = Union[retries.Retry, object] # type: ignore {% filter sort_lines %} {% for method in service.methods.values() %} diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2 index 0c2d02515e..497253509c 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2 @@ -25,7 +25,7 @@ from google.oauth2 import service_account # type: ignore try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + OptionalRetry = Union[retries.Retry, object] # type: ignore {% filter sort_lines %} {% for method in service.methods.values() %} diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 index 18da5c25d5..c18bb97b71 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 @@ -18,7 +18,7 @@ import warnings try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + OptionalRetry = Union[retries.Retry, object] # type: ignore {% extends '_base.py.j2' %} diff --git a/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py b/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py index c441f94236..02d7f82d9a 100644 --- a/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py +++ b/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py @@ -29,7 +29,7 @@ try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + 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/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/client.py b/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/client.py index e30290b690..c19054bca2 100644 --- a/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/client.py +++ b/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/client.py @@ -33,7 +33,7 @@ try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + 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/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py b/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py index 3cbf23faa3..a9cff2011a 100644 --- a/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py +++ b/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py @@ -29,7 +29,7 @@ try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + OptionalRetry = Union[retries.Retry, object] # type: ignore from google.iam.credentials_v1.types import common from google.protobuf import duration_pb2 # type: ignore diff --git a/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/client.py b/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/client.py index 2ba74e5a04..197d1b31e9 100644 --- a/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/client.py +++ b/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/client.py @@ -33,7 +33,7 @@ try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + OptionalRetry = Union[retries.Retry, object] # type: ignore from google.iam.credentials_v1.types import common from google.protobuf import duration_pb2 # type: ignore diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py index 5fd915a7e8..cb5c0ee175 100644 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py @@ -29,7 +29,7 @@ try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + OptionalRetry = Union[retries.Retry, object] # type: ignore from google.cloud.logging_v2.services.config_service_v2 import pagers from google.cloud.logging_v2.types import logging_config diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/client.py index 3ad1093024..b64accc724 100644 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/client.py @@ -33,7 +33,7 @@ try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + OptionalRetry = Union[retries.Retry, object] # type: ignore from google.cloud.logging_v2.services.config_service_v2 import pagers from google.cloud.logging_v2.types import logging_config diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py index 3db85f6818..4e03051f4a 100644 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py @@ -29,7 +29,7 @@ try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + OptionalRetry = Union[retries.Retry, object] # type: ignore from google.api import monitored_resource_pb2 # type: ignore from google.cloud.logging_v2.services.logging_service_v2 import pagers diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/client.py index 4a440b12e1..8040956255 100644 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/client.py @@ -33,7 +33,7 @@ try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + OptionalRetry = Union[retries.Retry, object] # type: ignore from google.api import monitored_resource_pb2 # type: ignore from google.cloud.logging_v2.services.logging_service_v2 import pagers diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py index 09f6c8701b..7d2286fecd 100644 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py @@ -29,7 +29,7 @@ try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + OptionalRetry = Union[retries.Retry, object] # type: ignore from google.api import distribution_pb2 # type: ignore from google.api import metric_pb2 # type: ignore diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/client.py index 5514f71581..6fc9886c4e 100644 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/client.py @@ -33,7 +33,7 @@ try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + OptionalRetry = Union[retries.Retry, object] # type: ignore from google.api import distribution_pb2 # type: ignore from google.api import metric_pb2 # type: ignore diff --git a/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py index f00c9123c8..2ab7db2a3d 100644 --- a/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py +++ b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py @@ -29,7 +29,7 @@ try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + 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/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/client.py b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/client.py index 3613db9d41..af2fc74885 100644 --- a/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/client.py +++ b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/client.py @@ -33,7 +33,7 @@ try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: - OptionalRetry = Union[retries.Retry, object] + OptionalRetry = Union[retries.Retry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore