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

types-protobuf overshadows google-cloud packages #1423

Closed
John15321 opened this issue Nov 24, 2022 · 2 comments
Closed

types-protobuf overshadows google-cloud packages #1423

John15321 opened this issue Nov 24, 2022 · 2 comments
Labels
api: bigquery Issues related to the googleapis/python-bigquery API.

Comments

@John15321
Copy link

Environment details

  • OS type and version: Issue present on all OSs
  • Python version: present on versions 3.8, 3.9, 3.10
  • pip version: on versions from 22 to 23
  • google-cloud-bigquery version: 3.3.6

Steps to reproduce

Hi
The issue here is that the types-protobuf pakcage overshadows anything that google-cloud-* tried to export (by that I mean any google api package like google-cloud-bigquery or google-cloud-storage) which results in IDEs, language servers and all types of linters and type checkers failing even tho the code runs succesfully.

The issue is very simple to reproduce, simply install a package like google-cloud-bigquery and try to use it in your code.

When you open your IDE it will look something like this:
image

Tools like mypy or pylint will also not have a problem with that.

However if you install the types-protobuf package, which will be installed if you install types-all (that package is frequently installed in order for mypy to have type resolution for as many things as possible)m you will start getting errors like this (no matter the IDE):
image

Even tho the code will run succesfully.
I am not sure if this is the fault of the types-protobuf package or maybe the google packages export something in a bad manner. I am simply reporting this issue, I am making a twin report in types-protobuf repo (python/typeshed#9267).

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Nov 24, 2022
@John15321 John15321 changed the title types-protobuf overshadowns google-cloud` packages types-protobuf overshadowns google-cloud packages Nov 24, 2022
@John15321 John15321 changed the title types-protobuf overshadowns google-cloud packages types-protobuf overshadows google-cloud packages Nov 24, 2022
@meredithslota
Copy link
Contributor

Root cause was in the typeshed repo, and it's now fixed (see linked issue, fix is here: python/typeshed#8360). I'm going to close this out but if you see this crop up again, please let us know! Thanks for filing!

@John15321
Copy link
Author

Great! Thanks 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API.
Projects
None yet
Development

No branches or pull requests

2 participants