Skip to content

Commit

Permalink
chore: Update mypy version (#1185)
Browse files Browse the repository at this point in the history
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
mukund-ananthu and gcf-owl-bot[bot] committed Jun 7, 2024
1 parent cfd7926 commit e2576b6
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion google/cloud/pubsub_v1/publisher/_batch/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(
client: "PublisherClient",
topic: str,
settings: "types.BatchSettings",
batch_done_callback: Callable[[bool], Any] = None,
batch_done_callback: Optional[Callable[[bool], Any]] = None,
commit_when_full: bool = True,
commit_retry: "OptionalRetry" = gapic_v1.method.DEFAULT,
commit_timeout: "types.OptionalTimeout" = gapic_v1.method.DEFAULT,
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/pubsub_v1/publisher/futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def cancelled(self) -> bool:
"""
return False

def result(self, timeout: Union[int, float] = None) -> str:
def result(self, timeout: Union[int, float, None] = None) -> str:
"""Return the message ID or raise an exception.
This blocks until the message has been published successfully and
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/pubsub_v1/subscriber/_protocol/helper_threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import logging
import queue
import time
from typing import Any, Callable, List, Sequence
from typing import Any, Callable, List, Sequence, Optional
import uuid


Expand All @@ -32,7 +32,7 @@


def _get_many(
queue_: queue.Queue, max_items: int = None, max_latency: float = 0
queue_: queue.Queue, max_items: Optional[int] = None, max_latency: float = 0
) -> List[Any]:
"""Get multiple items from a Queue.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def __init__(
client: "subscriber.Client",
subscription: str,
flow_control: types.FlowControl = types.FlowControl(),
scheduler: ThreadScheduler = None,
scheduler: Optional[ThreadScheduler] = None,
use_legacy_flow_control: bool = False,
await_callbacks_on_shutdown: bool = False,
):
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/pubsub_v1/subscriber/futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def cancelled(self) -> bool:
"""
return False

def result(self, timeout: Union[int, float] = None) -> AcknowledgeStatus:
def result(self, timeout: Union[int, float, None] = None) -> AcknowledgeStatus:
"""Return a success code or raise an exception.
This blocks until the operation completes successfully and
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/pubsub_v1/subscriber/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def shutdown(
work_item = self._executor._work_queue.get(block=False)
if work_item is None: # Exceutor in shutdown mode.
continue
dropped_messages.append(work_item.args[0])
dropped_messages.append(work_item.args[0]) # type: ignore[index]
except queue.Empty:
pass

Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
ISORT_VERSION = "isort==5.11.0"
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

MYPY_VERSION = "mypy==0.910"
MYPY_VERSION = "mypy==1.10.0"

DEFAULT_PYTHON_VERSION = "3.8"

Expand Down
2 changes: 1 addition & 1 deletion owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
s.replace(
"noxfile.py",
r"LINT_PATHS = \[.*?\]",
'\g<0>\n\nMYPY_VERSION = "mypy==0.910"',
'\g<0>\n\nMYPY_VERSION = "mypy==1.10.0"',
)
s.replace(
"noxfile.py", r'"blacken",', '\g<0>\n "mypy",',
Expand Down

0 comments on commit e2576b6

Please sign in to comment.