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: Typecheck errors in samples/snippets/subscriber.py #1186

Merged
merged 7 commits into from
Jun 7, 2024
6 changes: 5 additions & 1 deletion samples/snippets/mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ strict = True
exclude = noxfile\.py
warn_unused_configs = True

[mypy-avro.*,backoff,flaky]
; Ignore errors caused due to missing library stubs or py.typed marker
; Refer https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-library-stubs-or-py-typed-marker
; Errors ignored instead of adding stubs as as a workaround, since this directory contains sample code
mukund-ananthu marked this conversation as resolved.
Show resolved Hide resolved
; that does not affect the functionality of the client library.
[mypy-avro.*,backoff,flaky,google.cloud.*]
ignore_missing_imports = True
12 changes: 8 additions & 4 deletions samples/snippets/subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,10 @@ def update_subscription_with_dead_letter_policy(
)

with subscriber:
subscription_after_update = subscriber.update_subscription(
request={"subscription": subscription, "update_mask": update_mask}
subscription_after_update: gapic_types.Subscription = (
subscriber.update_subscription(
request={"subscription": subscription, "update_mask": update_mask}
)
)

print(f"After the update: {subscription_after_update}.")
Expand Down Expand Up @@ -573,8 +575,10 @@ def remove_dead_letter_policy(
)

with subscriber:
subscription_after_update = subscriber.update_subscription(
request={"subscription": subscription, "update_mask": update_mask}
subscription_after_update: gapic_types.Subscription = (
subscriber.update_subscription(
request={"subscription": subscription, "update_mask": update_mask}
)
)

print(f"After removing the policy: {subscription_after_update}.")
Expand Down