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: add context manager return types #1468

Merged
merged 3 commits into from
Jan 9, 2023

Conversation

henribru
Copy link
Contributor

@henribru henribru commented Oct 13, 2022

Currently the __enter__ method of a service client has no annotated return type. While some type checkers infer return types, Mypy doesn't, so this means that in a statement like with FooClient(...) as client:, client ends up as Any if you use Mypy. This PR simply makes the very small change of explicitly annotating this return type (due to its size and simplicity it seemed overkill to create an issue first).

@henribru henribru requested review from a team as code owners October 13, 2022 18:32
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Oct 13, 2022
@henribru henribru force-pushed the context-manager-return-type branch from 4fc665e to 442fbfa Compare October 13, 2022 18:40
@henribru henribru changed the title Add context manager return types fix: add context manager return types Oct 13, 2022
@parthea parthea added the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 9, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 9, 2023
parthea
parthea previously approved these changes Jan 9, 2023
@parthea parthea added the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 9, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 9, 2023
@parthea parthea added the automerge: exact Summon MOG for automerging, but approvals need to be against the latest commit label Jan 9, 2023
@gcf-merge-on-green gcf-merge-on-green bot dismissed parthea’s stale review January 9, 2023 18:04

This review does not reference the most recent commit, and you are using the secure version of merge-on-green. Please re-review the most recent commit.

@parthea parthea merged commit e0b38d3 into googleapis:main Jan 9, 2023
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge: exact Summon MOG for automerging, but approvals need to be against the latest commit label Jan 9, 2023
@henribru henribru deleted the context-manager-return-type branch January 9, 2023 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants