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

[ServiceBus&EventHubs] fix mypy 0.931 errors #23017

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/eventhub/azure-eventhub/azure/eventhub/_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from azure.core.credentials import TokenCredential

_LOGGER = logging.getLogger(__name__)
_Address = collections.namedtuple("Address", "hostname path")
_Address = collections.namedtuple("_Address", "hostname path")


def _parse_conn_str(conn_str, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import uuid
import datetime
import warnings
from typing import Any, List, Optional, Dict, Iterator, Union, TYPE_CHECKING
from typing import Any, List, Optional, Dict, Iterator, Union, TYPE_CHECKING, cast

import six

Expand Down Expand Up @@ -692,6 +692,7 @@ def receive_deferred_messages(
raise ValueError("The timeout must be greater than 0.")
if isinstance(sequence_numbers, six.integer_types):
sequence_numbers = [sequence_numbers]
sequence_numbers = cast(List[int], sequence_numbers)
if len(sequence_numbers) == 0:
return [] # no-op on empty list.
self._open()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import functools
import logging
import warnings
from typing import Any, List, Optional, AsyncIterator, Union, Callable, TYPE_CHECKING
from typing import Any, List, Optional, AsyncIterator, Union, Callable, TYPE_CHECKING, cast

import six

Expand Down Expand Up @@ -678,6 +678,7 @@ async def receive_deferred_messages(
raise ValueError("The timeout must be greater than 0.")
if isinstance(sequence_numbers, six.integer_types):
sequence_numbers = [sequence_numbers]
sequence_numbers = cast(List[int], sequence_numbers)
if len(sequence_numbers) == 0:
return [] # no-op on empty list.
await self._open()
Expand Down