From 0b19502f577eda62d492c6dcfd57d19afc5a9c6d Mon Sep 17 00:00:00 2001 From: Mukund Ananthu Date: Fri, 7 Jun 2024 16:09:33 +0000 Subject: [PATCH 1/4] fix: Typecheck errors in samples/snippets/subscriber.py --- samples/snippets/mypy.ini | 4 +++- samples/snippets/subscriber.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/samples/snippets/mypy.ini b/samples/snippets/mypy.ini index 8f2bae69a..76ed7e7a7 100644 --- a/samples/snippets/mypy.ini +++ b/samples/snippets/mypy.ini @@ -4,5 +4,7 @@ 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 +[mypy-avro.*,backoff,flaky,google.cloud.*] ignore_missing_imports = True diff --git a/samples/snippets/subscriber.py b/samples/snippets/subscriber.py index ab0c8aafa..f03a1def1 100644 --- a/samples/snippets/subscriber.py +++ b/samples/snippets/subscriber.py @@ -528,7 +528,7 @@ def update_subscription_with_dead_letter_policy( ) with subscriber: - subscription_after_update = subscriber.update_subscription( + subscription_after_update: gapic_types.Subscription = subscriber.update_subscription( request={"subscription": subscription, "update_mask": update_mask} ) @@ -573,7 +573,7 @@ def remove_dead_letter_policy( ) with subscriber: - subscription_after_update = subscriber.update_subscription( + subscription_after_update: gapic_types.Subscription = subscriber.update_subscription( request={"subscription": subscription, "update_mask": update_mask} ) From 8814ef7f677c4e387aa718512acbe64ce7d591c4 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 7 Jun 2024 18:05:12 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- samples/snippets/subscriber.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/samples/snippets/subscriber.py b/samples/snippets/subscriber.py index f03a1def1..2cd03b785 100644 --- a/samples/snippets/subscriber.py +++ b/samples/snippets/subscriber.py @@ -528,8 +528,10 @@ def update_subscription_with_dead_letter_policy( ) with subscriber: - subscription_after_update: gapic_types.Subscription = 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}.") @@ -573,8 +575,10 @@ def remove_dead_letter_policy( ) with subscriber: - subscription_after_update: gapic_types.Subscription = 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}.") From e351182db3069edb48bf36ec2970dafde2d7c81b Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 7 Jun 2024 18:05:22 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- samples/snippets/subscriber.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/samples/snippets/subscriber.py b/samples/snippets/subscriber.py index f03a1def1..2cd03b785 100644 --- a/samples/snippets/subscriber.py +++ b/samples/snippets/subscriber.py @@ -528,8 +528,10 @@ def update_subscription_with_dead_letter_policy( ) with subscriber: - subscription_after_update: gapic_types.Subscription = 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}.") @@ -573,8 +575,10 @@ def remove_dead_letter_policy( ) with subscriber: - subscription_after_update: gapic_types.Subscription = 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}.") From a6fbe99eb1719a416eaae3489c814394ddc2a964 Mon Sep 17 00:00:00 2001 From: mukund-ananthu <83691193+mukund-ananthu@users.noreply.github.com> Date: Fri, 7 Jun 2024 14:28:02 -0400 Subject: [PATCH 4/4] Update samples/snippets/mypy.ini Co-authored-by: Anthonios Partheniou --- samples/snippets/mypy.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/mypy.ini b/samples/snippets/mypy.ini index 42bcb2d32..3c8dd6f41 100644 --- a/samples/snippets/mypy.ini +++ b/samples/snippets/mypy.ini @@ -6,7 +6,7 @@ warn_unused_configs = True ; 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 +; Errors ignored instead of adding stubs as a workaround, since this directory contains sample code ; that does not affect the functionality of the client library. [mypy-avro.*,backoff,flaky,google.cloud.*] ignore_missing_imports = True