Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mypy error in asset golden files when adding dependency for google-cloud-org-policy #1806

Open
parthea opened this issue Oct 17, 2023 · 0 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: process A process-related concern. May include testing, release, or the like.

Comments

@parthea
Copy link
Contributor

parthea commented Oct 17, 2023

The dependency google-cloud-org-policy is needed in the generated client for //google/cloud/asset/v1. See https://github.com/googleapis/python-asset/blob/7c1f5fec48364889da95d21042278a9d944688c4/setup.py#L42

In PR #1805, when the GAPIC dependency google-cloud-org-policy was added, mypy tests fail with error Variable "google.cloud.orgpolicy.v1.orgpolicy_pb2.Policy" is not valid as a type .

See the build log here and stack trace below

nox > Running session mypy-3.11
nox > Creating virtual environment (virtualenv) using python3.11 in .nox/mypy-3-11
nox > python -m pip install mypy types-requests types-protobuf
nox > python -m pip install .
nox > mypy --explicit-package-bases google
google/cloud/asset_v1/types/assets.py:266: error: Variable "google.cloud.orgpolicy.v1.orgpolicy_pb2.Policy" is not valid as a type  [valid-type]
google/cloud/asset_v1/types/assets.py:266: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
Found 1 error in 1 file (checked 17 source files)

We don't currently have type stubs for google-cloud-org-policy so adding it would be a good starting point. Missing type stubs are missing in several core dependencies. Also see issue in googleapis/python-api-common-protos#135 for missing type stubs in googleapis-common-protos.

@ohmayr ohmayr added priority: p2 Moderately-important priority. Fix may not be included in next release. type: process A process-related concern. May include testing, release, or the like. labels Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

No branches or pull requests

2 participants