Skip to content

Commit 84d7383

Browse files
fix(servicebus): use real return-type annotations on list_*_sessions
Replace the legacy '# type:' return comment with explicit '-> List[str]' annotations on list_queue_sessions and list_subscription_sessions in both the sync and async ServiceBusClient. Matches other modern public APIs and surfaces the return type to type checkers and IDE tooling.
1 parent 17df2fc commit 84d7383

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

sdk/servicebus/azure-servicebus/azure/servicebus/_servicebus_client.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
55
# pylint: disable=client-method-missing-tracing-decorator
6-
from typing import Any, Union, Optional, TYPE_CHECKING, Type
6+
from typing import Any, List, Union, Optional, TYPE_CHECKING, Type
77
from datetime import datetime
88
import logging
99
import warnings
@@ -734,8 +734,7 @@ def list_queue_sessions(
734734
updated_since: Optional[datetime] = None,
735735
timeout: Optional[float] = None,
736736
**kwargs: Any,
737-
):
738-
# type: (...) -> list[str]
737+
) -> List[str]:
739738
"""List session IDs with active messages in a session-enabled queue.
740739
741740
If ``updated_since`` is specified, only sessions whose state was updated
@@ -767,8 +766,7 @@ def list_subscription_sessions(
767766
updated_since: Optional[datetime] = None,
768767
timeout: Optional[float] = None,
769768
**kwargs: Any,
770-
):
771-
# type: (...) -> list[str]
769+
) -> List[str]:
772770
"""List session IDs with active messages in a session-enabled subscription.
773771
774772
If ``updated_since`` is specified, only sessions whose state was updated

sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_client_async.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
55
# pylint: disable=client-method-missing-tracing-decorator
6-
from typing import Any, Union, Optional, TYPE_CHECKING, Type
6+
from typing import Any, List, Union, Optional, TYPE_CHECKING, Type
77
from datetime import datetime
88
import logging
99
import warnings
@@ -723,8 +723,7 @@ async def list_queue_sessions(
723723
updated_since: Optional[datetime] = None,
724724
timeout: Optional[float] = None,
725725
**kwargs: Any,
726-
):
727-
# type: (...) -> list[str]
726+
) -> List[str]:
728727
"""List session IDs with active messages in a session-enabled queue.
729728
730729
If ``updated_since`` is specified, only sessions whose state was updated
@@ -756,8 +755,7 @@ async def list_subscription_sessions(
756755
updated_since: Optional[datetime] = None,
757756
timeout: Optional[float] = None,
758757
**kwargs: Any,
759-
):
760-
# type: (...) -> list[str]
758+
) -> List[str]:
761759
"""List session IDs with active messages in a session-enabled subscription.
762760
763761
If ``updated_since`` is specified, only sessions whose state was updated

0 commit comments

Comments
 (0)