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

Make __all__ expose classes for use in type annotations #1287

Open
OscarVanL opened this issue Nov 1, 2024 · 0 comments
Open

Make __all__ expose classes for use in type annotations #1287

OscarVanL opened this issue Nov 1, 2024 · 0 comments
Assignees
Labels
api: pubsub Issues related to the googleapis/python-pubsub API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@OscarVanL
Copy link

OscarVanL commented Nov 1, 2024

Is your feature request related to a problem? Please describe.
I would like to type annotate my Pubsub subscriber callback as:
callable[[pubsub_v1.subscriber.message.Message], None] to match the callback function signature described here: https://cloud.google.com/pubsub/docs/publish-receive-messages-client-library

However, when I do this, my IDE (PyCharm) complains saying: Cannot find reference 'message' in '__init__.py'

This is because pubsub_v1.subscriber.__init__.py only has __all__ = ("Client",), meaning this is all that is suggested as an exported value.

Describe the solution you'd like
Expose the pubsub_v1.subscriber.message.Message in __all__ so I can add type annotations. I expect there are other types that it would be helpful to expose here too.

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/python-pubsub API. label Nov 1, 2024
@mukund-ananthu mukund-ananthu added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/python-pubsub API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants