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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve AsyncQuery typing #782

Merged
merged 1 commit into from Oct 17, 2023

Conversation

sergiterupri
Copy link
Contributor

@sergiterupri sergiterupri commented Oct 16, 2023

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:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #781 馃

@sergiterupri sergiterupri requested review from a team as code owners October 16, 2023 15:18
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: firestore Issues related to the googleapis/python-firestore API. labels Oct 16, 2023
@daniel-sanche
Copy link
Contributor

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,
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@daniel-sanche daniel-sanche added kokoro:run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Oct 17, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 17, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 17, 2023
@daniel-sanche daniel-sanche changed the title Fix AsyncQuery typing fix: improve AsyncQuery typing Oct 17, 2023
@daniel-sanche daniel-sanche merged commit ae1247b into googleapis:main Oct 17, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/python-firestore API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Small typing improvement for AsyncCollectionReference and AsyncQuery
3 participants