-
Notifications
You must be signed in to change notification settings - Fork 75
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
fix: improve AsyncQuery typing #782
Conversation
b93c581
to
4fa1d9b
Compare
Thanks for putting this together. I noticed recently that the typechecking test is currently not working properly, so the types declared in this library will have flaws until that is resolved |
@@ -756,8 +764,9 @@ def end_before( | |||
) | |||
|
|||
def end_at( | |||
self, document_fields_or_snapshot: Union[DocumentSnapshot, dict, list, tuple] | |||
) -> "BaseQuery": | |||
self: QueryType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: it shouldn't be necessary to include type annotations for self (mypy doesn't require it, and we typically don't include them in other GCP libraries).
Is there a reason it's needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback! I wanted to make it explicit on the function signature that the return type was of the same type as the object calling it.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #781 🦕