Skip to content

Commit bcc4170

Browse files
Small set of non-blocking changes from b6. (#13690)
- adds EOF whitespace - renames _id to _session_id - Adjusts docstring type Closes #13686
1 parent 430e884 commit bcc4170

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

sdk/servicebus/azure-servicebus/azure/servicebus/_servicebus_session.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
class BaseSession(object):
3131
def __init__(self, session_id, receiver, encoding="UTF-8"):
3232
# type: (str, Union[ServiceBusSessionReceiver, ServiceBusSessionReceiverAsync], str) -> None
33-
self._id = session_id
33+
self._session_id = session_id
3434
self._receiver = receiver
3535
self._encoding = encoding
3636
self._session_start = None
@@ -58,7 +58,7 @@ def session_id(self):
5858
5959
:rtype: str
6060
"""
61-
return self._id
61+
return self._session_id
6262

6363
@property
6464
def locked_until_utc(self):
@@ -110,7 +110,7 @@ def get_state(self):
110110
self._check_live()
111111
response = self._receiver._mgmt_request_response_with_retry( # pylint: disable=protected-access
112112
REQUEST_RESPONSE_GET_SESSION_STATE_OPERATION,
113-
{MGMT_REQUEST_SESSION_ID: self._id},
113+
{MGMT_REQUEST_SESSION_ID: self._session_id},
114114
mgmt_handlers.default
115115
)
116116
session_state = response.get(MGMT_RESPONSE_SESSION_STATE)
@@ -138,7 +138,7 @@ def set_state(self, state):
138138
state = state.encode(self._encoding) if isinstance(state, six.text_type) else state
139139
return self._receiver._mgmt_request_response_with_retry( # pylint: disable=protected-access
140140
REQUEST_RESPONSE_SET_SESSION_STATE_OPERATION,
141-
{MGMT_REQUEST_SESSION_ID: self._id, MGMT_REQUEST_SESSION_STATE: bytearray(state)},
141+
{MGMT_REQUEST_SESSION_ID: self._session_id, MGMT_REQUEST_SESSION_STATE: bytearray(state)},
142142
mgmt_handlers.default
143143
)
144144

@@ -169,7 +169,7 @@ def renew_lock(self):
169169
self._check_live()
170170
expiry = self._receiver._mgmt_request_response_with_retry( # pylint: disable=protected-access
171171
REQUEST_RESPONSE_RENEW_SESSION_LOCK_OPERATION,
172-
{MGMT_REQUEST_SESSION_ID: self._id},
172+
{MGMT_REQUEST_SESSION_ID: self._session_id},
173173
mgmt_handlers.default
174174
)
175175
expiry_timestamp = expiry[MGMT_RESPONSE_RECEIVER_EXPIRATION]/1000.0

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ async def get_state(self):
6060
self._check_live()
6161
response = await self._receiver._mgmt_request_response_with_retry( # pylint: disable=protected-access
6262
REQUEST_RESPONSE_GET_SESSION_STATE_OPERATION,
63-
{MGMT_REQUEST_SESSION_ID: self._id},
63+
{MGMT_REQUEST_SESSION_ID: self._session_id},
6464
mgmt_handlers.default
6565
)
6666
session_state = response.get(MGMT_RESPONSE_SESSION_STATE)
@@ -89,7 +89,7 @@ async def set_state(self, state):
8989
state = state.encode(self._encoding) if isinstance(state, six.text_type) else state
9090
return await self._receiver._mgmt_request_response_with_retry( # pylint: disable=protected-access
9191
REQUEST_RESPONSE_SET_SESSION_STATE_OPERATION,
92-
{MGMT_REQUEST_SESSION_ID: self._id, MGMT_REQUEST_SESSION_STATE: bytearray(state)},
92+
{MGMT_REQUEST_SESSION_ID: self._session_id, MGMT_REQUEST_SESSION_STATE: bytearray(state)},
9393
mgmt_handlers.default
9494
)
9595

@@ -120,7 +120,7 @@ async def renew_lock(self):
120120
self._check_live()
121121
expiry = await self._receiver._mgmt_request_response_with_retry( # pylint: disable=protected-access
122122
REQUEST_RESPONSE_RENEW_SESSION_LOCK_OPERATION,
123-
{MGMT_REQUEST_SESSION_ID: self._id},
123+
{MGMT_REQUEST_SESSION_ID: self._session_id},
124124
mgmt_handlers.default
125125
)
126126
expiry_timestamp = expiry[MGMT_RESPONSE_RECEIVER_EXPIRATION]/1000.0

sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_management_client_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class ServiceBusAdministrationClient: #pylint:disable=too-many-public-methods
5353

5454
def __init__(
5555
self, fully_qualified_namespace: str,
56-
credential: Union["AsyncTokenCredential"],
56+
credential: "AsyncTokenCredential",
5757
**kwargs) -> None:
5858

5959
self.fully_qualified_namespace = fully_qualified_namespace

sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_namespaces_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ async def test_async_mgmt_namespace_get_properties(self, servicebus_namespace_co
2222
assert properties
2323
assert properties.messaging_sku == 'Standard'
2424
# assert properties.name == servicebus_namespace.name
25-
# This is disabled pending investigation of why it isn't getting scrubbed despite expected scrubber use.
25+
# This is disabled pending investigation of why it isn't getting scrubbed despite expected scrubber use.

0 commit comments

Comments
 (0)