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

[FR] Add return type annotations for public functions (firestore.client(), storage.bucket(), etc) #626

Open
guneemwelloeux opened this issue Jul 15, 2022 · 5 comments

Comments

@guneemwelloeux
Copy link

Is your feature request related to a problem? Please describe.
VSCode can use Python type annotations to provide a much better experience, and allow completion.

Describe the solution you'd like
function signatures should return a return type, to allow completions. For example, in firestore.py
def client() -> google.cloud.firestore.Client would allow completion on client().collection("something"), etc.

Describe alternatives you've considered
As a workaround, I'm using the following today:

from firebase_admin import firestore
from google.cloud.firestore import Client as FirestoreClient # importing the return type of firestore.client()
db: FirestoreClient = firestore.client() # Adding an annotation to my db variable, to enable completion and syntax checking

Additional context
Using the latest VSCode, with the Pylance extension.

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@lahirumaramba
Copy link
Member

Thank you @guneemwelloeux for filing this feature request. We have started adding type hints to new code (ex: #621) and will eventually add type hints to existing code in the future. In the meantime, if you or anyone in the community would like to send a PR we are glad to take a look. Thank you!

@mohitCodepy
Copy link

@lahirumaramba , Would you please assign me to this issue?

@mohitCodepy
Copy link

@lahirumaramba , Just for more clearity on the issue, Is there any way where I can connect with you guys directly because I'm highly interested to contribute here?

@lahirumaramba
Copy link
Member

Hi @mohitCodepy Thank you for your interests in contributing to the codebase! Please refer to https://github.com/firebase/firebase-admin-python/blob/master/CONTRIBUTING.md for more information about how you can contribute to this project. You will need to fork the repo, make the changes, and submit a pull request. We would be happy to review any PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants