Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 78eb0a1

Browse filesBrowse files
fix: fix mypy errors (#15483)
Towards #15104 This is needed to unblock #15457 which has the following mypy failure for `google-cloud-automl` ``` nox > mypy -p google .nox/mypy-3-14/lib/python3.14/site-packages/google/cloud/automl_v1beta1/services/tables/gcs_client.py:25: error: Library stubs not installed for "pandas" [import-untyped] .nox/mypy-3-14/lib/python3.14/site-packages/google/cloud/automl_v1beta1/services/tables/gcs_client.py:25: note: Hint: "python3 -m pip install pandas-stubs" .nox/mypy-3-14/lib/python3.14/site-packages/google/cloud/automl_v1beta1/services/tables/gcs_client.py:25: note: (or run "mypy --install-types" to install all missing stub packages) .nox/mypy-3-14/lib/python3.14/site-packages/google/cloud/automl_v1beta1/services/tables/gcs_client.py:25: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports .nox/mypy-3-14/lib/python3.14/site-packages/google/cloud/automl_v1beta1/services/tables/gcs_client.py:30: error: Module "google.cloud" has no attribute "storage" [attr-defined] ``` See follow up bug for`google-cloud-storage` : https://github.com/googleapis/python-storage/issues/318 See follow up bug for pre-release failure: googleapis/proto-plus-python#558 See follow up bug to add `--strict` flag for mypy: https://github.com/googleapis/gapic-generator-python/issues/2089 --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 871cdee commit 78eb0a1
Copy full SHA for 78eb0a1

3 files changed

+17-3Lines changed: 17 additions & 3 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.librarian/generator-input/client-post-processing/integrate-isolated-handwritten-code.yaml‎

Copy file name to clipboardExpand all lines: .librarian/generator-input/client-post-processing/integrate-isolated-handwritten-code.yaml
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,3 +290,14 @@ replacements:
290290
after: |
291291
UNIT_TEST_EXTRAS: List[str] = ["pandas", "storage"]
292292
count: 1
293+
- paths: [
294+
packages/google-cloud-automl/noxfile.py,
295+
]
296+
before: |
297+
"types-protobuf",
298+
\ \)
299+
after: |
300+
"types-protobuf",
301+
"pandas-stubs",
302+
)
303+
count: 1
Collapse file

‎packages/google-cloud-automl/google/cloud/automl_v1beta1/services/tables/gcs_client.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-automl/google/cloud/automl_v1beta1/services/tables/gcs_client.py
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@
2424
try:
2525
import pandas
2626
except ImportError: # pragma: NO COVER
27-
pandas = None
27+
pandas = None # type: ignore[assignment]
2828

2929
try:
30-
from google.cloud import storage
30+
# TODO(https://github.com/googleapis/python-storage/issues/318):
31+
# Remove `type: ignore` once this bug is fixed
32+
from google.cloud import storage # type: ignore[attr-defined]
3133
except ImportError: # pragma: NO COVER
32-
storage = None
34+
storage = None # type: ignore[assignment]
3335

3436
_LOGGER = logging.getLogger(__name__)
3537
_PANDAS_REQUIRED = "pandas is required to verify type DataFrame."
Collapse file

‎packages/google-cloud-automl/noxfile.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-automl/noxfile.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def mypy(session):
101101
"mypy<1.16.0",
102102
"types-requests",
103103
"types-protobuf",
104+
"pandas-stubs",
104105
)
105106
session.install(".")
106107
session.run(

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.