Skip to content

Commit

Permalink
Update retry param typing in PubSubAsyncHook (#36198)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
josh-fell committed Dec 13, 2023
1 parent 82b3c11 commit 8fbacb8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions airflow/providers/google/cloud/hooks/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

if TYPE_CHECKING:
from google.api_core.retry import Retry
from google.api_core.retry_async import AsyncRetry
from google.cloud.pubsub_v1.types import (
DeadLetterPolicy,
Duration,
Expand Down Expand Up @@ -611,7 +612,7 @@ async def acknowledge(
project_id: str,
ack_ids: list[str] | None = None,
messages: list[ReceivedMessage] | None = None,
retry: Retry | _MethodDefault = DEFAULT,
retry: AsyncRetry | _MethodDefault = DEFAULT,
timeout: float | None = None,
metadata: Sequence[tuple[str, str]] = (),
) -> None:
Expand Down Expand Up @@ -665,7 +666,7 @@ async def pull(
max_messages: int,
project_id: str = PROVIDE_PROJECT_ID,
return_immediately: bool = False,
retry: Retry | _MethodDefault = DEFAULT,
retry: AsyncRetry | _MethodDefault = DEFAULT,
timeout: float | None = None,
metadata: Sequence[tuple[str, str]] = (),
) -> list[ReceivedMessage]:
Expand Down
2 changes: 1 addition & 1 deletion airflow/providers/google/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ dependencies:
- google-cloud-monitoring>=2.14.1
- google-cloud-orchestration-airflow>=1.10.0
- google-cloud-os-login>=2.9.1
- google-cloud-pubsub>=2.15.0
- google-cloud-pubsub>=2.19.0
- google-cloud-redis>=2.12.0
- google-cloud-secret-manager>=2.16.0
- google-cloud-spanner>=3.11.1
Expand Down
2 changes: 1 addition & 1 deletion generated/provider_dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@
"google-cloud-monitoring>=2.14.1",
"google-cloud-orchestration-airflow>=1.10.0",
"google-cloud-os-login>=2.9.1",
"google-cloud-pubsub>=2.15.0",
"google-cloud-pubsub>=2.19.0",
"google-cloud-redis>=2.12.0",
"google-cloud-run>=0.9.0",
"google-cloud-secret-manager>=2.16.0",
Expand Down

0 comments on commit 8fbacb8

Please sign in to comment.