From 0d16d46f62a605b7548b26ad1ee7fe62428e8a4e Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 14 May 2026 06:53:35 -0400 Subject: [PATCH 01/10] chore: regenerate google-cloud-automl to resolve conflict --- .../automl-integration.yaml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .librarian/generator-input/client-post-processing/automl-integration.yaml diff --git a/.librarian/generator-input/client-post-processing/automl-integration.yaml b/.librarian/generator-input/client-post-processing/automl-integration.yaml new file mode 100644 index 000000000000..06cb34219237 --- /dev/null +++ b/.librarian/generator-input/client-post-processing/automl-integration.yaml @@ -0,0 +1,42 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +description: Update google-auth version to avoid dependency conflict +url: https://github.com/googleapis/google-cloud-python/issues/17131 +replacements: + - paths: [ + packages/google-cloud-automl/setup.py, + ] + before: | + dependencies = \[ + "google-api-core[grpc\] >= 2.17.1, <3.0.0", + # Exclude incompatible versions of `google-auth` + # See https://github.com/googleapis/google-cloud-python/issues/12364 + "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", + "grpcio >= 1.44.0, < 2.0.0", + "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", + "proto-plus >= 1.22.3, <2.0.0", + "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", + "protobuf >= 4.25.8, < 8.0.0", + after: | + dependencies = [ + "google-api-core[grpc] >= 2.17.1, <3.0.0", + # Exclude incompatible versions of `google-auth` + # See https://github.com/googleapis/google-cloud-python/issues/17131 + "google-auth >= 2.26.1, <3.0.0,!=2.24.0,!=2.25.0", + "grpcio >= 1.44.0, < 2.0.0", + "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", + "proto-plus >= 1.22.3, <2.0.0", + "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", + "protobuf >= 4.25.8, < 8.0.0", + count: 1 From 4490bd5a8113dd5bc34cba75eb9be04df87443c0 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 14 May 2026 08:03:58 -0400 Subject: [PATCH 02/10] Revert "chore: regenerate google-cloud-automl to resolve conflict" This reverts commit 0d16d46f62a605b7548b26ad1ee7fe62428e8a4e. --- .../automl-integration.yaml | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 .librarian/generator-input/client-post-processing/automl-integration.yaml diff --git a/.librarian/generator-input/client-post-processing/automl-integration.yaml b/.librarian/generator-input/client-post-processing/automl-integration.yaml deleted file mode 100644 index 06cb34219237..000000000000 --- a/.librarian/generator-input/client-post-processing/automl-integration.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -description: Update google-auth version to avoid dependency conflict -url: https://github.com/googleapis/google-cloud-python/issues/17131 -replacements: - - paths: [ - packages/google-cloud-automl/setup.py, - ] - before: | - dependencies = \[ - "google-api-core[grpc\] >= 2.17.1, <3.0.0", - # Exclude incompatible versions of `google-auth` - # See https://github.com/googleapis/google-cloud-python/issues/12364 - "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.44.0, < 2.0.0", - "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", - "proto-plus >= 1.22.3, <2.0.0", - "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", - "protobuf >= 4.25.8, < 8.0.0", - after: | - dependencies = [ - "google-api-core[grpc] >= 2.17.1, <3.0.0", - # Exclude incompatible versions of `google-auth` - # See https://github.com/googleapis/google-cloud-python/issues/17131 - "google-auth >= 2.26.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.44.0, < 2.0.0", - "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", - "proto-plus >= 1.22.3, <2.0.0", - "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", - "protobuf >= 4.25.8, < 8.0.0", - count: 1 From 127c9691ca917dd31fb59d0fe9e22833700f27de Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 14 May 2026 08:11:24 -0400 Subject: [PATCH 03/10] fix: resolve dependency conflict and missing reference to pandas --- .../automl-integration.yaml | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 .librarian/generator-input/client-post-processing/automl-integration.yaml diff --git a/.librarian/generator-input/client-post-processing/automl-integration.yaml b/.librarian/generator-input/client-post-processing/automl-integration.yaml new file mode 100644 index 000000000000..a2cce5e87e00 --- /dev/null +++ b/.librarian/generator-input/client-post-processing/automl-integration.yaml @@ -0,0 +1,129 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +description: Update google-auth version to avoid dependency conflict +url: https://github.com/googleapis/google-cloud-python/issues/17131 +replacements: + - paths: [ + packages/google-cloud-automl/setup.py, + ] + before: | + dependencies = \[ + "google-api-core[grpc\] >= 2.17.1, <3.0.0", + # Exclude incompatible versions of `google-auth` + # See https://github.com/googleapis/google-cloud-python/issues/12364 + "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", + "grpcio >= 1.44.0, < 2.0.0", + "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", + "proto-plus >= 1.22.3, <2.0.0", + "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", + "protobuf >= 4.25.8, < 8.0.0", + after: | + dependencies = [ + "google-api-core[grpc] >= 2.17.1, <3.0.0", + # Exclude incompatible versions of `google-auth` + # See https://github.com/googleapis/google-cloud-python/issues/17131 + "google-auth >= 2.26.1, <3.0.0,!=2.24.0,!=2.25.0", + "grpcio >= 1.44.0, < 2.0.0", + "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", + "proto-plus >= 1.22.3, <2.0.0", + "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", + "protobuf >= 4.25.8, < 8.0.0", + count: 1 + - paths: [ + packages/google-cloud-automl/setup.py, + ] + before: extras = \{\} + after: | + extras = { + "libcst": "libcst >= 0.2.5", + "pandas": ["pandas>=1.1.3"], + "storage": ["google-cloud-storage >=2.14.0, <4.0.0"], + } + count: 1 + - paths: [ + packages/google-cloud-automl/docs/automl_v1beta1/services_.rst, + ] + before: | + Services for Google Cloud Automl v1beta1 API + ============================================ + .. toctree:: + :maxdepth: 2 + + auto_ml + prediction_service + after: | + Services for Google Cloud Automl v1beta1 API + ============================================ + .. toctree:: + :maxdepth: 2 + + tables + auto_ml + prediction_service + count: 1 + - paths: [ + packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py, + ] + before: | + \) + from .types.annotation_payload import AnnotationPayload + after: | + ) + from .services.tables.gcs_client import GcsClient + from .services.tables.tables_client import TablesClient + from .types.annotation_payload import AnnotationPayload + count: 1 + - paths: [ + packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py, + ] + before: | + __all__ = \( + "AutoMlAsyncClient", + after: | + __all__ = ( + "GcsClient", + "TablesClient", + "AutoMlAsyncClient", + count: 1 + - paths: [ + packages/google-cloud-automl/noxfile.py, + ] + before: | + UNIT_TEST_EXTRAS: List\[str\] = \[\] + after: | + UNIT_TEST_EXTRAS: List[str] = ["pandas", "storage"] + count: 1 + - paths: [ + packages/google-cloud-automl/noxfile.py, + ] + before: | + unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES + after: | + unit_deps_all = ( + UNIT_TEST_STANDARD_DEPENDENCIES + + UNIT_TEST_EXTERNAL_DEPENDENCIES + + UNIT_TEST_EXTRAS + ) + count: 1 + - paths: [ + packages/google-cloud-automl/noxfile.py, + ] + before: | + "types-protobuf", + \ \) + after: | + "types-protobuf", + "pandas-stubs", + ) + count: 1 From 50a929d434e6ff7b68176199b28b9d463cd55f89 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 14 May 2026 08:14:59 -0400 Subject: [PATCH 04/10] chore: remove skip_generate from automl --- librarian.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/librarian.yaml b/librarian.yaml index e08851df3ae7..fb834d109a12 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -433,7 +433,6 @@ libraries: - google/cloud/automl_v1beta1/services/tables/__init__.py - google/cloud/automl_v1beta1/services/tables/gcs_client.py - google/cloud/automl_v1beta1/services/tables/tables_client.py - skip_generate: true python: library_type: GAPIC_COMBO metadata_name_override: automl From 11f28951a1dfb05db90c6991d874c9a6249fa3ae Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 14 May 2026 08:18:45 -0400 Subject: [PATCH 05/10] chore: removes refs to automl in integrate-isolated-handwritten-code.yaml --- .../integrate-isolated-handwritten-code.yaml | 75 ------------------- 1 file changed, 75 deletions(-) diff --git a/.librarian/generator-input/client-post-processing/integrate-isolated-handwritten-code.yaml b/.librarian/generator-input/client-post-processing/integrate-isolated-handwritten-code.yaml index 8141056571a6..fdd3207a62db 100644 --- a/.librarian/generator-input/client-post-processing/integrate-isolated-handwritten-code.yaml +++ b/.librarian/generator-input/client-post-processing/integrate-isolated-handwritten-code.yaml @@ -192,70 +192,6 @@ replacements: monitoring_v3/services_ monitoring_v3/types_ count: 1 - - paths: [ - packages/google-cloud-automl/setup.py, - ] - before: extras = \{\} - after: | - extras = { - "libcst": "libcst >= 0.2.5", - "pandas": ["pandas>=1.1.3"], - "storage": ["google-cloud-storage >=2.14.0, <4.0.0"], - } - count: 1 - - paths: [ - packages/google-cloud-automl/docs/automl_v1beta1/services_.rst, - ] - before: | - Services for Google Cloud Automl v1beta1 API - ============================================ - .. toctree:: - :maxdepth: 2 - - auto_ml - prediction_service - after: | - Services for Google Cloud Automl v1beta1 API - ============================================ - .. toctree:: - :maxdepth: 2 - - tables - auto_ml - prediction_service - count: 1 - - paths: [ - packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py, - ] - before: | - \) - from .types.annotation_payload import AnnotationPayload - after: | - ) - from .services.tables.gcs_client import GcsClient - from .services.tables.tables_client import TablesClient - from .types.annotation_payload import AnnotationPayload - count: 1 - - paths: [ - packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py, - ] - before: | - __all__ = \( - "AutoMlAsyncClient", - after: | - __all__ = ( - "GcsClient", - "TablesClient", - "AutoMlAsyncClient", - count: 1 - - paths: [ - packages/google-cloud-automl/noxfile.py, - ] - before: | - UNIT_TEST_EXTRAS: List\[str\] = \[\] - after: | - UNIT_TEST_EXTRAS: List[str] = ["pandas", "storage"] - count: 1 - paths: [ packages/google-cloud-logging/noxfile.py, ] @@ -270,17 +206,6 @@ replacements: "opentelemetry-sdk", ] count: 1 - - paths: [ - packages/google-cloud-automl/noxfile.py, - ] - before: | - "types-protobuf", - \ \) - after: | - "types-protobuf", - "pandas-stubs", - ) - count: 1 - paths: [ packages/google-cloud-monitoring/noxfile.py, ] From 4958205ea2947350a6fa3593f0687218e9943d4b Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 14 May 2026 08:59:06 -0400 Subject: [PATCH 06/10] fix: updates post-processing regex --- .../automl-integration.yaml | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.librarian/generator-input/client-post-processing/automl-integration.yaml b/.librarian/generator-input/client-post-processing/automl-integration.yaml index a2cce5e87e00..b3d1727891f8 100644 --- a/.librarian/generator-input/client-post-processing/automl-integration.yaml +++ b/.librarian/generator-input/client-post-processing/automl-integration.yaml @@ -18,16 +18,7 @@ replacements: packages/google-cloud-automl/setup.py, ] before: | - dependencies = \[ - "google-api-core[grpc\] >= 2.17.1, <3.0.0", - # Exclude incompatible versions of `google-auth` - # See https://github.com/googleapis/google-cloud-python/issues/12364 - "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.44.0, < 2.0.0", - "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", - "proto-plus >= 1.22.3, <2.0.0", - "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", - "protobuf >= 4.25.8, < 8.0.0", + dependencies = [\s\S]*?"protobuf >= 4.25.8, < 8.0.0", after: | dependencies = [ "google-api-core[grpc] >= 2.17.1, <3.0.0", @@ -43,7 +34,8 @@ replacements: - paths: [ packages/google-cloud-automl/setup.py, ] - before: extras = \{\} + before: | + extras = \{\} after: | extras = { "libcst": "libcst >= 0.2.5", @@ -108,12 +100,12 @@ replacements: packages/google-cloud-automl/noxfile.py, ] before: | - unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES + unit_deps_all[\s\S]*?UNIT_TEST_EXTERNAL_DEPENDENCIES after: | unit_deps_all = ( UNIT_TEST_STANDARD_DEPENDENCIES - + UNIT_TEST_EXTERNAL_DEPENDENCIES - + UNIT_TEST_EXTRAS + \+ UNIT_TEST_EXTERNAL_DEPENDENCIES + \+ UNIT_TEST_EXTRAS ) count: 1 - paths: [ From 238065d470c9b8cfc75634504a028d110d524cde Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 14 May 2026 09:57:16 -0400 Subject: [PATCH 07/10] chore: updates regex patterns --- .../automl-integration.yaml | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/.librarian/generator-input/client-post-processing/automl-integration.yaml b/.librarian/generator-input/client-post-processing/automl-integration.yaml index b3d1727891f8..c28ed8b79f33 100644 --- a/.librarian/generator-input/client-post-processing/automl-integration.yaml +++ b/.librarian/generator-input/client-post-processing/automl-integration.yaml @@ -17,8 +17,7 @@ replacements: - paths: [ packages/google-cloud-automl/setup.py, ] - before: | - dependencies = [\s\S]*?"protobuf >= 4.25.8, < 8.0.0", + before: '(?s)dependencies = \[.*?\]\nextras = \{\}' after: | dependencies = [ "google-api-core[grpc] >= 2.17.1, <3.0.0", @@ -30,13 +29,7 @@ replacements: "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", "protobuf >= 4.25.8, < 8.0.0", - count: 1 - - paths: [ - packages/google-cloud-automl/setup.py, - ] - before: | - extras = \{\} - after: | + ] extras = { "libcst": "libcst >= 0.2.5", "pandas": ["pandas>=1.1.3"], @@ -99,15 +92,15 @@ replacements: - paths: [ packages/google-cloud-automl/noxfile.py, ] - before: | - unit_deps_all[\s\S]*?UNIT_TEST_EXTERNAL_DEPENDENCIES + before: '(?s)([ \t]+)unit_deps_all = (?:(?!UNIT_TEST_EXTRAS)[\s\S])*?session\.install\(\*unit_deps_all\)' after: | - unit_deps_all = ( - UNIT_TEST_STANDARD_DEPENDENCIES - \+ UNIT_TEST_EXTERNAL_DEPENDENCIES - \+ UNIT_TEST_EXTRAS - ) - count: 1 + \g<1>unit_deps_all = ( + \g<1> UNIT_TEST_STANDARD_DEPENDENCIES + \g<1> + UNIT_TEST_EXTERNAL_DEPENDENCIES + \g<1> + UNIT_TEST_EXTRAS + \g<1>) + \g<1>session.install(*unit_deps_all) + count: 2 - paths: [ packages/google-cloud-automl/noxfile.py, ] From 65f02a501ed257c8f17c0161acd8d2fc90a2bdf0 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 14 May 2026 09:57:42 -0400 Subject: [PATCH 08/10] chore: adds generated content --- packages/google-cloud-automl/docs/conf.py | 4 +- .../google/cloud/automl_v1/__init__.py | 25 +---- .../services/auto_ml/async_client.py | 38 ++++---- .../prediction_service/async_client.py | 6 +- .../google/cloud/automl_v1/types/io.py | 71 +++++++++----- .../google/cloud/automl_v1beta1/__init__.py | 25 +---- .../services/auto_ml/async_client.py | 38 ++++---- .../prediction_service/async_client.py | 6 +- packages/google-cloud-automl/noxfile.py | 16 +++- ..._generated_auto_ml_create_dataset_async.py | 6 +- ...v1_generated_auto_ml_create_model_async.py | 6 +- ..._generated_auto_ml_delete_dataset_async.py | 6 +- ...v1_generated_auto_ml_delete_model_async.py | 6 +- ...v1_generated_auto_ml_deploy_model_async.py | 6 +- ..._v1_generated_auto_ml_export_data_async.py | 6 +- ...v1_generated_auto_ml_export_model_async.py | 6 +- ..._v1_generated_auto_ml_import_data_async.py | 6 +- ..._generated_auto_ml_undeploy_model_async.py | 6 +- ..._prediction_service_batch_predict_async.py | 6 +- ...a1_generated_auto_ml_create_model_async.py | 6 +- ..._generated_auto_ml_delete_dataset_async.py | 6 +- ...a1_generated_auto_ml_delete_model_async.py | 6 +- ...a1_generated_auto_ml_deploy_model_async.py | 6 +- ...ta1_generated_auto_ml_export_data_async.py | 6 +- ...auto_ml_export_evaluated_examples_async.py | 6 +- ...a1_generated_auto_ml_export_model_async.py | 6 +- ...ta1_generated_auto_ml_import_data_async.py | 6 +- ..._generated_auto_ml_undeploy_model_async.py | 6 +- ..._prediction_service_batch_predict_async.py | 6 +- packages/google-cloud-automl/setup.py | 15 ++- .../testing/constraints-3.10.txt | 21 +++-- .../testing/constraints-3.9.txt | 18 ---- .../unit/gapic/automl_v1/test_auto_ml.py | 68 +++++--------- .../automl_v1/test_prediction_service.py | 18 ++-- .../unit/gapic/automl_v1beta1/test_auto_ml.py | 92 +++++++------------ .../automl_v1beta1/test_prediction_service.py | 18 ++-- 36 files changed, 260 insertions(+), 339 deletions(-) delete mode 100644 packages/google-cloud-automl/testing/constraints-3.9.txt diff --git a/packages/google-cloud-automl/docs/conf.py b/packages/google-cloud-automl/docs/conf.py index e6d0f2d68e42..05a107396697 100644 --- a/packages/google-cloud-automl/docs/conf.py +++ b/packages/google-cloud-automl/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-automl" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-automl/google/cloud/automl_v1/__init__.py b/packages/google-cloud-automl/google/cloud/automl_v1/__init__.py index 2968bc863430..60d64076048b 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1/__init__.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.auto_ml import AutoMlAsyncClient, AutoMlClient from .services.prediction_service import ( @@ -149,28 +143,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.automl_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1/services/auto_ml/async_client.py b/packages/google-cloud-automl/google/cloud/automl_v1/services/auto_ml/async_client.py index a1e1e4366cce..a223d25a04a4 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1/services/auto_ml/async_client.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1/services/auto_ml/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -365,11 +365,11 @@ async def sample_create_dataset(): ) # Make the request - operation = client.create_dataset(request=request) + operation = await client.create_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -869,11 +869,11 @@ async def sample_delete_dataset(): ) # Make the request - operation = client.delete_dataset(request=request) + operation = await client.delete_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1016,11 +1016,11 @@ async def sample_import_data(): ) # Make the request - operation = client.import_data(request=request) + operation = await client.import_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1168,11 +1168,11 @@ async def sample_export_data(): ) # Make the request - operation = client.export_data(request=request) + operation = await client.export_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1424,11 +1424,11 @@ async def sample_create_model(): ) # Make the request - operation = client.create_model(request=request) + operation = await client.create_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1796,11 +1796,11 @@ async def sample_delete_model(): ) # Make the request - operation = client.delete_model(request=request) + operation = await client.delete_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2064,11 +2064,11 @@ async def sample_deploy_model(): ) # Make the request - operation = client.deploy_model(request=request) + operation = await client.deploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2205,11 +2205,11 @@ async def sample_undeploy_model(): ) # Make the request - operation = client.undeploy_model(request=request) + operation = await client.undeploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2350,11 +2350,11 @@ async def sample_export_model(): ) # Make the request - operation = client.export_model(request=request) + operation = await client.export_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1/services/prediction_service/async_client.py b/packages/google-cloud-automl/google/cloud/automl_v1/services/prediction_service/async_client.py index 565550a1576d..881cdbaf08f2 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1/services/prediction_service/async_client.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1/services/prediction_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -570,11 +570,11 @@ async def sample_batch_predict(): ) # Make the request - operation = client.batch_predict(request=request) + operation = await client.batch_predict(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1/types/io.py b/packages/google-cloud-automl/google/cloud/automl_v1/types/io.py index 26ec3699d57b..41262d1beb31 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1/types/io.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1/types/io.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -55,9 +55,11 @@ class InputConfig(proto.Message): with non-terminal symbols defined near the end of this comment. The formats are: - AutoML Vision: + AutoML Vision + ^^^^^^^^^^^^^ - Classification: + Classification + '''''''''''''' See `Preparing your training data `__ for @@ -98,7 +100,8 @@ class InputConfig(proto.Message): UNASSIGNED,gs://folder/image3.jpg,daisy UNASSIGNED,gs://folder/image4.jpg - Object Detection: + Object Detection + '''''''''''''''' See `Preparing your training data `__ @@ -148,9 +151,11 @@ class InputConfig(proto.Message): - AutoML Video Intelligence: + AutoML Video Intelligence + ^^^^^^^^^^^^^^^^^^^^^^^^^ - Classification: + Classification + '''''''''''''' See `Preparing your training data `__ @@ -200,7 +205,8 @@ class InputConfig(proto.Message): gs://folder/vid2.avi,car,0,60.5 gs://folder/vid3.avi,,, - Object Tracking: + Object Tracking + ''''''''''''''' See `Preparing your training data `__ @@ -263,9 +269,11 @@ class InputConfig(proto.Message): gs://folder/video2.avi,car,1,0,.1,.9,,,.9,.1,, gs://folder/video2.avi,,,,,,,,,,, - AutoML Natural Language: + AutoML Natural Language + ^^^^^^^^^^^^^^^^^^^^^^^ - Entity Extraction: + Entity Extraction + ''''''''''''''''' See `Preparing your training data `__ for @@ -459,7 +467,8 @@ class InputConfig(proto.Message): }, ], - Classification: + Classification + '''''''''''''' See `Preparing your training data `__ @@ -511,7 +520,8 @@ class InputConfig(proto.Message): TEST,gs://folder/document.pdf VALIDATE,gs://folder/text_files.zip,BadFood - Sentiment Analysis: + Sentiment Analysis + '''''''''''''''''' See `Preparing your training data `__ @@ -574,7 +584,8 @@ class InputConfig(proto.Message): TEST,gs://folder/document.pdf VALIDATE,gs://folder/text_files.zip,2 - AutoML Tables: + AutoML Tables + ^^^^^^^^^^^^^ See `Preparing your training data `__ for @@ -691,7 +702,8 @@ class InputConfig(proto.Message): semantic of the imported data, any string must be up to 25000 characters long. - AutoML Tables: + AutoML Tables + ^^^^^^^^^^^^^ ``schema_inference_version`` : (integer) This value must be supplied. The version of the algorithm to use for the @@ -724,9 +736,11 @@ class BatchPredictInputConfig(proto.Message): with non-terminal symbols defined near the end of this comment. The formats are: - AutoML Vision: + AutoML Vision + ^^^^^^^^^^^^^ - Classification: + Classification + '''''''''''''' One or more CSV files where each line is a single column: @@ -746,7 +760,8 @@ class BatchPredictInputConfig(proto.Message): gs://folder/image2.gif gs://folder/image3.png - Object Detection: + Object Detection + '''''''''''''''' One or more CSV files where each line is a single column: @@ -766,9 +781,11 @@ class BatchPredictInputConfig(proto.Message): gs://folder/image2.gif gs://folder/image3.png - AutoML Video Intelligence: + AutoML Video Intelligence + ^^^^^^^^^^^^^^^^^^^^^^^^^ - Classification: + Classification + '''''''''''''' One or more CSV files where each line is a single column: @@ -791,7 +808,8 @@ class BatchPredictInputConfig(proto.Message): gs://folder/video1.mp4,20,60 gs://folder/vid2.mov,0,inf - Object Tracking: + Object Tracking + ''''''''''''''' One or more CSV files where each line is a single column: @@ -814,9 +832,11 @@ class BatchPredictInputConfig(proto.Message): gs://folder/video1.mp4,20,60 gs://folder/vid2.mov,0,inf - AutoML Natural Language: + AutoML Natural Language + ^^^^^^^^^^^^^^^^^^^^^^^ - Classification: + Classification + '''''''''''''' One or more CSV files where each line is a single column: @@ -837,7 +857,8 @@ class BatchPredictInputConfig(proto.Message): gs://folder/text2.pdf gs://folder/text3.tif - Sentiment Analysis: + Sentiment Analysis + '''''''''''''''''' One or more CSV files where each line is a single column: @@ -858,7 +879,8 @@ class BatchPredictInputConfig(proto.Message): gs://folder/text2.pdf gs://folder/text3.tif - Entity Extraction: + Entity Extraction + ''''''''''''''''' One or more JSONL (JSON Lines) files that either provide inline text or documents. You can only use one format, either inline text or @@ -933,7 +955,8 @@ class BatchPredictInputConfig(proto.Message): } } - AutoML Tables: + AutoML Tables + ^^^^^^^^^^^^^ See `Preparing your training data `__ diff --git a/packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py b/packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py index 310edefc5778..07baf5afcb7c 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.auto_ml import AutoMlAsyncClient, AutoMlClient from .services.prediction_service import ( @@ -195,28 +189,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.automl_v1beta1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/auto_ml/async_client.py b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/auto_ml/async_client.py index bbc60a196714..340116618550 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/auto_ml/async_client.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/auto_ml/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -859,11 +859,11 @@ async def sample_delete_dataset(): ) # Make the request - operation = client.delete_dataset(request=request) + operation = await client.delete_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1002,11 +1002,11 @@ async def sample_import_data(): ) # Make the request - operation = client.import_data(request=request) + operation = await client.import_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1150,11 +1150,11 @@ async def sample_export_data(): ) # Make the request - operation = client.export_data(request=request) + operation = await client.export_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2120,11 +2120,11 @@ async def sample_create_model(): ) # Make the request - operation = client.create_model(request=request) + operation = await client.create_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2492,11 +2492,11 @@ async def sample_delete_model(): ) # Make the request - operation = client.delete_model(request=request) + operation = await client.delete_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2639,11 +2639,11 @@ async def sample_deploy_model(): ) # Make the request - operation = client.deploy_model(request=request) + operation = await client.deploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2780,11 +2780,11 @@ async def sample_undeploy_model(): ) # Make the request - operation = client.undeploy_model(request=request) + operation = await client.undeploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2922,11 +2922,11 @@ async def sample_export_model(): ) # Make the request - operation = client.export_model(request=request) + operation = await client.export_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3081,11 +3081,11 @@ async def sample_export_evaluated_examples(): ) # Make the request - operation = client.export_evaluated_examples(request=request) + operation = await client.export_evaluated_examples(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/prediction_service/async_client.py b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/prediction_service/async_client.py index 1b7f0dc86888..48806d2da5aa 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/prediction_service/async_client.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/prediction_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -536,11 +536,11 @@ async def sample_batch_predict(): ) # Make the request - operation = client.batch_predict(request=request) + operation = await client.batch_predict(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/noxfile.py b/packages/google-cloud-automl/noxfile.py index 4e126e3abe91..43fa91de2993 100644 --- a/packages/google-cloud-automl/noxfile.py +++ b/packages/google-cloud-automl/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -391,7 +390,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", @@ -467,7 +465,11 @@ def prerelease_deps(session, protobuf_implementation): session.install("-e", ".") # Install dependencies for the unit test environment - unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES + unit_deps_all = ( + UNIT_TEST_STANDARD_DEPENDENCIES + + UNIT_TEST_EXTERNAL_DEPENDENCIES + + UNIT_TEST_EXTRAS + ) session.install(*unit_deps_all) # Install dependencies for the system test environment @@ -560,7 +562,11 @@ def core_deps_from_source(session, protobuf_implementation): session.install("-e", ".") # Install dependencies for the unit test environment - unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES + unit_deps_all = ( + UNIT_TEST_STANDARD_DEPENDENCIES + + UNIT_TEST_EXTERNAL_DEPENDENCIES + + UNIT_TEST_EXTRAS + ) session.install(*unit_deps_all) # Install dependencies for the system test environment diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py index ebdce3d3ca7e..e39d2a112f0a 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -53,11 +53,11 @@ async def sample_create_dataset(): ) # Make the request - operation = client.create_dataset(request=request) + operation = await client.create_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_model_async.py index 3f05c7b83e4d..7f3576f0ca4f 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_create_model(): ) # Make the request - operation = client.create_model(request=request) + operation = await client.create_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_dataset_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_dataset_async.py index 4f79dbb43392..bf73628b9b51 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_dataset_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_dataset_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_dataset(): ) # Make the request - operation = client.delete_dataset(request=request) + operation = await client.delete_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_model_async.py index 994476f3e411..6ec9f3a4a899 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_model(): ) # Make the request - operation = client.delete_model(request=request) + operation = await client.delete_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_deploy_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_deploy_model_async.py index 2b6aa5e36da0..70df9ca4f525 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_deploy_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_deploy_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_deploy_model(): ) # Make the request - operation = client.deploy_model(request=request) + operation = await client.deploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_data_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_data_async.py index eda683a06cd8..823afa076c57 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_data_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_data_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_export_data(): ) # Make the request - operation = client.export_data(request=request) + operation = await client.export_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_model_async.py index babad52490b0..96c993fe4da2 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_export_model(): ) # Make the request - operation = client.export_model(request=request) + operation = await client.export_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_import_data_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_import_data_async.py index 0df6eba7ab30..ab0f9b6ffd0c 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_import_data_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_import_data_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_import_data(): ) # Make the request - operation = client.import_data(request=request) + operation = await client.import_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_undeploy_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_undeploy_model_async.py index 91b9a168f270..1e11c6ac8086 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_undeploy_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_undeploy_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_undeploy_model(): ) # Make the request - operation = client.undeploy_model(request=request) + operation = await client.undeploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_prediction_service_batch_predict_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_prediction_service_batch_predict_async.py index 5f19c4226683..7d85d80ed7ab 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_prediction_service_batch_predict_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_prediction_service_batch_predict_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -52,11 +52,11 @@ async def sample_batch_predict(): ) # Make the request - operation = client.batch_predict(request=request) + operation = await client.batch_predict(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_create_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_create_model_async.py index 76b87740d080..b4be09c5429a 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_create_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_create_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_create_model(): ) # Make the request - operation = client.create_model(request=request) + operation = await client.create_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_dataset_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_dataset_async.py index a4c6e1d7ec82..91aec7607d10 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_dataset_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_dataset_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_dataset(): ) # Make the request - operation = client.delete_dataset(request=request) + operation = await client.delete_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_model_async.py index c98857b95be5..bec81527b747 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_model(): ) # Make the request - operation = client.delete_model(request=request) + operation = await client.delete_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_deploy_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_deploy_model_async.py index f4de388af10e..aa5c2f3ef761 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_deploy_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_deploy_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_deploy_model(): ) # Make the request - operation = client.deploy_model(request=request) + operation = await client.deploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_data_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_data_async.py index a30f6af27324..2c98e3d4e1d4 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_data_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_data_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_export_data(): ) # Make the request - operation = client.export_data(request=request) + operation = await client.export_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py index b970f50ac5be..7ed13eb71741 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_export_evaluated_examples(): ) # Make the request - operation = client.export_evaluated_examples(request=request) + operation = await client.export_evaluated_examples(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_model_async.py index 65ee458d4dd8..d95878ad49ec 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_export_model(): ) # Make the request - operation = client.export_model(request=request) + operation = await client.export_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_import_data_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_import_data_async.py index e28851a3899e..23c576be2c00 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_import_data_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_import_data_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_import_data(): ) # Make the request - operation = client.import_data(request=request) + operation = await client.import_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_undeploy_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_undeploy_model_async.py index 131f7e327dcf..df2160110cfe 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_undeploy_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_undeploy_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_undeploy_model(): ) # Make the request - operation = client.undeploy_model(request=request) + operation = await client.undeploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_prediction_service_batch_predict_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_prediction_service_batch_predict_async.py index 18600baf725f..b7af37fbd6e3 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_prediction_service_batch_predict_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_prediction_service_batch_predict_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_batch_predict(): ) # Make the request - operation = client.batch_predict(request=request) + operation = await client.batch_predict(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/setup.py b/packages/google-cloud-automl/setup.py index d92d1981fe09..5d417e718551 100644 --- a/packages/google-cloud-automl/setup.py +++ b/packages/google-cloud-automl/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -39,11 +39,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` - # See https://github.com/googleapis/google-cloud-python/issues/12364 - "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + # See https://github.com/googleapis/google-cloud-python/issues/17131 + "google-auth >= 2.26.1, <3.0.0,!=2.24.0,!=2.25.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -76,7 +76,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -84,7 +84,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -95,7 +94,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-automl/testing/constraints-3.10.txt b/packages/google-cloud-automl/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-automl/testing/constraints-3.10.txt +++ b/packages/google-cloud-automl/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-automl/testing/constraints-3.9.txt b/packages/google-cloud-automl/testing/constraints-3.9.txt deleted file mode 100644 index 60e67851a5fa..000000000000 --- a/packages/google-cloud-automl/testing/constraints-3.9.txt +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-cloud-storage==2.14.0 -libcst==0.2.5 -pandas==1.1.3 -# numpy is a dependency of pandas -numpy==1.19.3 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_auto_ml.py b/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_auto_ml.py index 85020d51d6c8..879cab860a75 100644 --- a/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_auto_ml.py +++ b/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_auto_ml.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2474,11 +2468,7 @@ async def test_list_datasets_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_datasets(request={}) - ).pages: + async for page_ in (await client.list_datasets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5440,11 +5430,7 @@ async def test_list_models_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_models(request={}) - ).pages: + async for page_ in (await client.list_models(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8058,11 +8044,7 @@ async def test_list_model_evaluations_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_model_evaluations(request={}) - ).pages: + async for page_ in (await client.list_model_evaluations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8176,7 +8158,7 @@ def test_create_dataset_rest_required_fields(request_type=service.CreateDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_dataset_rest_unset_required_fields(): @@ -8367,7 +8349,7 @@ def test_get_dataset_rest_required_fields(request_type=service.GetDatasetRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_dataset_rest_unset_required_fields(): @@ -8550,7 +8532,7 @@ def test_list_datasets_rest_required_fields(request_type=service.ListDatasetsReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_datasets_rest_unset_required_fields(): @@ -8793,7 +8775,7 @@ def test_update_dataset_rest_required_fields(request_type=service.UpdateDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_dataset_rest_unset_required_fields(): @@ -8990,7 +8972,7 @@ def test_delete_dataset_rest_required_fields(request_type=service.DeleteDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_dataset_rest_unset_required_fields(): @@ -9165,7 +9147,7 @@ def test_import_data_rest_required_fields(request_type=service.ImportDataRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_data_rest_unset_required_fields(): @@ -9355,7 +9337,7 @@ def test_export_data_rest_required_fields(request_type=service.ExportDataRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_data_rest_unset_required_fields(): @@ -9553,7 +9535,7 @@ def test_get_annotation_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_annotation_spec_rest_unset_required_fields(): @@ -9733,7 +9715,7 @@ def test_create_model_rest_required_fields(request_type=service.CreateModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_model_rest_unset_required_fields(): @@ -9924,7 +9906,7 @@ def test_get_model_rest_required_fields(request_type=service.GetModelRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_model_rest_unset_required_fields(): @@ -10107,7 +10089,7 @@ def test_list_models_rest_required_fields(request_type=service.ListModelsRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_models_rest_unset_required_fields(): @@ -10353,7 +10335,7 @@ def test_delete_model_rest_required_fields(request_type=service.DeleteModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_model_rest_unset_required_fields(): @@ -10524,7 +10506,7 @@ def test_update_model_rest_required_fields(request_type=service.UpdateModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_model_rest_unset_required_fields(): @@ -10722,7 +10704,7 @@ def test_deploy_model_rest_required_fields(request_type=service.DeployModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_deploy_model_rest_unset_required_fields(): @@ -10898,7 +10880,7 @@ def test_undeploy_model_rest_required_fields(request_type=service.UndeployModelR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_undeploy_model_rest_unset_required_fields(): @@ -11074,7 +11056,7 @@ def test_export_model_rest_required_fields(request_type=service.ExportModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_model_rest_unset_required_fields(): @@ -11272,7 +11254,7 @@ def test_get_model_evaluation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_model_evaluation_rest_unset_required_fields(): @@ -11478,7 +11460,7 @@ def test_list_model_evaluations_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_model_evaluations_rest_unset_required_fields(): diff --git a/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_prediction_service.py b/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_prediction_service.py index 604b4a7e6d94..150a650704b4 100644 --- a/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_prediction_service.py +++ b/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_prediction_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2210,7 +2204,7 @@ def test_predict_rest_required_fields(request_type=prediction_service.PredictReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_predict_rest_unset_required_fields(): @@ -2406,7 +2400,7 @@ def test_batch_predict_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_predict_rest_unset_required_fields(): diff --git a/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_auto_ml.py b/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_auto_ml.py index 17adbaf502f2..bfdfcb0279fc 100644 --- a/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_auto_ml.py +++ b/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_auto_ml.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2491,11 +2485,7 @@ async def test_list_datasets_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_datasets(request={}) - ).pages: + async for page_ in (await client.list_datasets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5098,11 +5088,7 @@ async def test_list_table_specs_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_table_specs(request={}) - ).pages: + async for page_ in (await client.list_table_specs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6329,11 +6315,7 @@ async def test_list_column_specs_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_column_specs(request={}) - ).pages: + async for page_ in (await client.list_column_specs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7885,11 +7867,7 @@ async def test_list_models_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_models(request={}) - ).pages: + async for page_ in (await client.list_models(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10504,11 +10482,7 @@ async def test_list_model_evaluations_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_model_evaluations(request={}) - ).pages: + async for page_ in (await client.list_model_evaluations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10621,7 +10595,7 @@ def test_create_dataset_rest_required_fields(request_type=service.CreateDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_dataset_rest_unset_required_fields(): @@ -10815,7 +10789,7 @@ def test_get_dataset_rest_required_fields(request_type=service.GetDatasetRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_dataset_rest_unset_required_fields(): @@ -10999,7 +10973,7 @@ def test_list_datasets_rest_required_fields(request_type=service.ListDatasetsReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_datasets_rest_unset_required_fields(): @@ -11243,7 +11217,7 @@ def test_update_dataset_rest_required_fields(request_type=service.UpdateDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_dataset_rest_unset_required_fields(): @@ -11430,7 +11404,7 @@ def test_delete_dataset_rest_required_fields(request_type=service.DeleteDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_dataset_rest_unset_required_fields(): @@ -11606,7 +11580,7 @@ def test_import_data_rest_required_fields(request_type=service.ImportDataRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_data_rest_unset_required_fields(): @@ -11796,7 +11770,7 @@ def test_export_data_rest_required_fields(request_type=service.ExportDataRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_data_rest_unset_required_fields(): @@ -11994,7 +11968,7 @@ def test_get_annotation_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_annotation_spec_rest_unset_required_fields(): @@ -12174,7 +12148,7 @@ def test_get_table_spec_rest_required_fields(request_type=service.GetTableSpecRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_table_spec_rest_unset_required_fields(): @@ -12365,7 +12339,7 @@ def test_list_table_specs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_table_specs_rest_unset_required_fields(): @@ -12618,7 +12592,7 @@ def test_update_table_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_table_spec_rest_unset_required_fields(): @@ -12802,7 +12776,7 @@ def test_get_column_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_column_spec_rest_unset_required_fields(): @@ -12993,7 +12967,7 @@ def test_list_column_specs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_column_specs_rest_unset_required_fields(): @@ -13248,7 +13222,7 @@ def test_update_column_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_column_spec_rest_unset_required_fields(): @@ -13430,7 +13404,7 @@ def test_create_model_rest_required_fields(request_type=service.CreateModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_model_rest_unset_required_fields(): @@ -13622,7 +13596,7 @@ def test_get_model_rest_required_fields(request_type=service.GetModelRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_model_rest_unset_required_fields(): @@ -13806,7 +13780,7 @@ def test_list_models_rest_required_fields(request_type=service.ListModelsRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_models_rest_unset_required_fields(): @@ -14053,7 +14027,7 @@ def test_delete_model_rest_required_fields(request_type=service.DeleteModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_model_rest_unset_required_fields(): @@ -14229,7 +14203,7 @@ def test_deploy_model_rest_required_fields(request_type=service.DeployModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_deploy_model_rest_unset_required_fields(): @@ -14405,7 +14379,7 @@ def test_undeploy_model_rest_required_fields(request_type=service.UndeployModelR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_undeploy_model_rest_unset_required_fields(): @@ -14581,7 +14555,7 @@ def test_export_model_rest_required_fields(request_type=service.ExportModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_model_rest_unset_required_fields(): @@ -14782,7 +14756,7 @@ def test_export_evaluated_examples_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_evaluated_examples_rest_unset_required_fields(): @@ -14980,7 +14954,7 @@ def test_get_model_evaluation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_model_evaluation_rest_unset_required_fields(): @@ -15173,7 +15147,7 @@ def test_list_model_evaluations_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_model_evaluations_rest_unset_required_fields(): diff --git a/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_prediction_service.py b/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_prediction_service.py index 5761dae4fe1f..82e3197ef322 100644 --- a/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_prediction_service.py +++ b/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_prediction_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2211,7 +2205,7 @@ def test_predict_rest_required_fields(request_type=prediction_service.PredictReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_predict_rest_unset_required_fields(): @@ -2407,7 +2401,7 @@ def test_batch_predict_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_predict_rest_unset_required_fields(): From ad662c7e4ebfa38ecafb877e58aa04f642e4c1c8 Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 14 May 2026 10:32:13 -0400 Subject: [PATCH 09/10] chore: updates regex patterns --- .../client-post-processing/automl-integration.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.librarian/generator-input/client-post-processing/automl-integration.yaml b/.librarian/generator-input/client-post-processing/automl-integration.yaml index c28ed8b79f33..924a0c3ca7d4 100644 --- a/.librarian/generator-input/client-post-processing/automl-integration.yaml +++ b/.librarian/generator-input/client-post-processing/automl-integration.yaml @@ -112,3 +112,9 @@ replacements: "pandas-stubs", ) count: 1 + - paths: [ + packages/google-cloud-automl/testing/constraints-3.10.txt, + ] + before: 'google-auth==2.14.1' + after: 'google-auth==2.26.1' + count: 1 From 4d94e960f52b4d5507f960fd582162eb5916884b Mon Sep 17 00:00:00 2001 From: chalmer lowe Date: Thu, 14 May 2026 10:32:39 -0400 Subject: [PATCH 10/10] chore: updates generated code --- packages/google-cloud-automl/testing/constraints-3.10.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-automl/testing/constraints-3.10.txt b/packages/google-cloud-automl/testing/constraints-3.10.txt index bac7ba85b4ee..2b8a10a433e8 100644 --- a/packages/google-cloud-automl/testing/constraints-3.10.txt +++ b/packages/google-cloud-automl/testing/constraints-3.10.txt @@ -5,7 +5,7 @@ # For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", # then this file should have google-cloud-foo==1.14.0 google-api-core==2.17.1 -google-auth==2.14.1 +google-auth==2.26.1 grpcio==1.44.0 proto-plus==1.22.3 protobuf==4.25.8