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

fix: type hinting in collection.py #688

Merged
merged 3 commits into from
Feb 17, 2023
Merged

Conversation

Sugihiru
Copy link
Contributor

@Sugihiru Sugihiru commented Feb 8, 2023

Mostly adding | None on all fields that may have None as a default value.

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 #687 🦕

@Sugihiru Sugihiru requested review from a team as code owners February 8, 2023 15:33
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: firestore Issues related to the googleapis/python-firestore API. labels Feb 8, 2023
Mostly adding `| None` on all fields that may have `None` as a default value.
Copy link
Contributor

@Mariatta Mariatta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

Copy link
Contributor

@Mariatta Mariatta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The | syntax is only available in Python 3.10+. Since we still support Python 3.7+, then this should be using Union instead of |.

e.g

from typing import Union

...
document_id: Union[str, None]

Use Union to be compatible with 3.7
@Mariatta Mariatta changed the title Fix type hinting in collection.py fix: type hinting in collection.py Feb 16, 2023
@Mariatta Mariatta added the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 16, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 16, 2023
@Mariatta Mariatta added the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 17, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 17, 2023
Copy link
Contributor

@Mariatta Mariatta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Mariatta Mariatta merged commit bfb97c2 into googleapis:main Feb 17, 2023
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: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pylance Typing for collections
2 participants