From 44c0fe1e338176ef2a6e2d4d795019453254d64d Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 23 Jan 2026 20:29:46 +0000 Subject: [PATCH 1/3] fix: fix mypy errors --- .../integrate-isolated-handwritten-code.yaml | 11 +++++++++++ .../automl_v1beta1/services/tables/gcs_client.py | 8 +++++--- packages/google-cloud-automl/noxfile.py | 1 + 3 files changed, 17 insertions(+), 3 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 e3161120ec0a..7ee33fd85053 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 @@ -290,3 +290,14 @@ replacements: after: | UNIT_TEST_EXTRAS: List[str] = ["pandas", "storage"] count: 1 + - paths: [ + packages/google-cloud-automl/noxfile.py, + ] + before: | + "types-protobuf", + \ \) + after: | + "types-protobuf", + "pandas-stubs", + ) + count: 1 diff --git a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/tables/gcs_client.py b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/tables/gcs_client.py index 99d40da2867c..ca129646f3db 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/tables/gcs_client.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/tables/gcs_client.py @@ -24,12 +24,14 @@ try: import pandas except ImportError: # pragma: NO COVER - pandas = None + pandas = None # type: ignore try: - from google.cloud import storage + # TODO(https://github.com/googleapis/python-storage/issues/318): + # Remove `type: ignore` once this bug is fixed + from google.cloud import storage # type: ignore except ImportError: # pragma: NO COVER - storage = None + storage = None # type: ignore _LOGGER = logging.getLogger(__name__) _PANDAS_REQUIRED = "pandas is required to verify type DataFrame." diff --git a/packages/google-cloud-automl/noxfile.py b/packages/google-cloud-automl/noxfile.py index bcafe0750c9a..4a482fbfa495 100644 --- a/packages/google-cloud-automl/noxfile.py +++ b/packages/google-cloud-automl/noxfile.py @@ -101,6 +101,7 @@ def mypy(session): "mypy<1.16.0", "types-requests", "types-protobuf", + "pandas-stubs", ) session.install(".") session.run( From 3eb3117b643a854ed65a0fd28263fe0c2097b059 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 23 Jan 2026 15:40:18 -0500 Subject: [PATCH 2/3] Apply suggestion from @gemini-code-assist[bot] Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- .../google/cloud/automl_v1beta1/services/tables/gcs_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/tables/gcs_client.py b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/tables/gcs_client.py index ca129646f3db..6f3850acf7e8 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/tables/gcs_client.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/tables/gcs_client.py @@ -24,7 +24,7 @@ try: import pandas except ImportError: # pragma: NO COVER - pandas = None # type: ignore + pandas = None # type: ignore[assignment] try: # TODO(https://github.com/googleapis/python-storage/issues/318): From f7fb2a764aad8fc1f522bbf85082544a311a8413 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 23 Jan 2026 15:40:43 -0500 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- .../google/cloud/automl_v1beta1/services/tables/gcs_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/tables/gcs_client.py b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/tables/gcs_client.py index 6f3850acf7e8..3fa86d22229b 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/tables/gcs_client.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/tables/gcs_client.py @@ -29,9 +29,9 @@ try: # TODO(https://github.com/googleapis/python-storage/issues/318): # Remove `type: ignore` once this bug is fixed - from google.cloud import storage # type: ignore + from google.cloud import storage # type: ignore[attr-defined] except ImportError: # pragma: NO COVER - storage = None # type: ignore + storage = None # type: ignore[assignment] _LOGGER = logging.getLogger(__name__) _PANDAS_REQUIRED = "pandas is required to verify type DataFrame."