Skip to content

Commit d7d782d

Browse files
josh-fellpotiuk
authored andcommitted
Update retry param typing in PubSubAsyncHook (#36198)
The `google-cloud-pubsub` library was [recently released](https://pypi.org/project/google-cloud-pubsub/2.19.0/) with a bug fix to update the `retry` parameter when using the SubscriberAsyncClient to AsyncRetry from Retry. Main builds were failing Mypy checks for this reason. (cherry picked from commit 8fbacb8)
1 parent 4e14cd1 commit d7d782d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

airflow/providers/google/cloud/hooks/pubsub.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949

5050
if TYPE_CHECKING:
5151
from google.api_core.retry import Retry
52+
from google.api_core.retry_async import AsyncRetry
5253
from google.cloud.pubsub_v1.types import (
5354
DeadLetterPolicy,
5455
Duration,
@@ -611,7 +612,7 @@ async def acknowledge(
611612
project_id: str,
612613
ack_ids: list[str] | None = None,
613614
messages: list[ReceivedMessage] | None = None,
614-
retry: Retry | _MethodDefault = DEFAULT,
615+
retry: AsyncRetry | _MethodDefault = DEFAULT,
615616
timeout: float | None = None,
616617
metadata: Sequence[tuple[str, str]] = (),
617618
) -> None:
@@ -665,7 +666,7 @@ async def pull(
665666
max_messages: int,
666667
project_id: str = PROVIDE_PROJECT_ID,
667668
return_immediately: bool = False,
668-
retry: Retry | _MethodDefault = DEFAULT,
669+
retry: AsyncRetry | _MethodDefault = DEFAULT,
669670
timeout: float | None = None,
670671
metadata: Sequence[tuple[str, str]] = (),
671672
) -> list[ReceivedMessage]:

airflow/providers/google/provider.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ dependencies:
114114
- google-cloud-monitoring>=2.14.1
115115
- google-cloud-orchestration-airflow>=1.10.0
116116
- google-cloud-os-login>=2.9.1
117-
- google-cloud-pubsub>=2.15.0
117+
- google-cloud-pubsub>=2.19.0
118118
- google-cloud-redis>=2.12.0
119119
- google-cloud-secret-manager>=2.16.0
120120
- google-cloud-spanner>=3.11.1

generated/provider_dependencies.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@
443443
"google-cloud-monitoring>=2.14.1",
444444
"google-cloud-orchestration-airflow>=1.10.0",
445445
"google-cloud-os-login>=2.9.1",
446-
"google-cloud-pubsub>=2.15.0",
446+
"google-cloud-pubsub>=2.19.0",
447447
"google-cloud-redis>=2.12.0",
448448
"google-cloud-run>=0.9.0",
449449
"google-cloud-secret-manager>=2.16.0",

0 commit comments

Comments
 (0)