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

refactor: use 'WhichOneof' for dispatch in 'Watch.on_snapshot' #500

Merged
merged 3 commits into from
Dec 23, 2021

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented Dec 7, 2021

Improve both performance and readability of Watch.on_snaphot by dispatching based on the response_type oneof: requires using the "raw" protobuf messages, which we also use where feasible for speed.

Replace oddball testing-only BackgroundConsumer and ResumableBidiRpc arguments to Watch with "standard" mocking.

Use "real" protobuf messages for testing, versus oddball manual mocks.

Based on branch for PR #499 -- I will rebase after that PR merges.

@tseaver tseaver requested review from tswast and kolea2 December 7, 2021 16:33
@tseaver tseaver requested a review from a team as a code owner December 7, 2021 16:33
@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/python-firestore API. label Dec 7, 2021
Also, remove weird mocking for BIDI classes.
@tseaver tseaver force-pushed the refactor-watch-on_snapshot branch from c912d41 to 20d45a1 Compare December 22, 2021 21:18
Copy link
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

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

Much cleaner! "oneof" for the win. Just a minor docstring suggestion

@tseaver tseaver merged commit e68e9de into main Dec 23, 2021
@tseaver tseaver deleted the refactor-watch-on_snapshot branch December 23, 2021 19:22
gcf-merge-on-green bot pushed a commit that referenced this pull request Jan 11, 2022
~~Based on branch for PR #500 -- I will rebase after that PR merges.~~

Closes #367.
    
Supersedes PR #497.
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants