You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the above PR, changes were made to SB so that dict representations of the following objects are
now accepted and can be sent:
ServiceBusMessage
QueueProperties
TopicProperties
SubscriptionProperties
RuleProperties
The API type hints that now accept dict representations of these objects should be updated to reflect the change. The type hint should show that an object of type typing.Mapping is accepted, NOT AN OBJECT OF TYPE Dict. Discussion for this update here: https://github.com/Azure/azure-sdk-for-python/pull/14807/files#r579153824.
The type hints for the following methods should be updated:
_from_list in message.py
add_message in message.py
schedule_messages in _servicebus_sender.py
send_messages in _servicebus_sender.py
schedule_messages in _servicebus_sender_async.py
send_messages in _servicebus_sender_async.py
update_queue, update_topic, update_subscription, update_rule in management/_management_client.py
update_queue, update_topic, update_subscription, update_rule in aio/management/_management_client_async.py
The text was updated successfully, but these errors were encountered:
need to update all the isinstance(x, dict) to some sort of validation that the dict is of type Mapping and conforms to the Mapping protocol. Below is a prototype of that check from Anna:
def _check_instance(input):
if isinstance(input, ServiceBusMessage):
return True
try:
dict_message = dict(intput)
dict['body] # Check that a required key is present
return True
except (ValueError, TypeError, KeyError):
raise ValueError("Message must be an instance of ServiceBusMessage or Mapping")
return False
add a test to check non-SBMessage-non-Mappable inputs raises an error as expected
Complete after : #14807
In the above PR, changes were made to SB so that dict representations of the following objects are
now accepted and can be sent:
The API type hints that now accept dict representations of these objects should be updated to reflect the change. The type hint should show that an object of type
typing.Mapping
is accepted, NOT AN OBJECT OF TYPEDict
. Discussion for this update here: https://github.com/Azure/azure-sdk-for-python/pull/14807/files#r579153824.The type hints for the following methods should be updated:
_from_list
inmessage.py
add_message
inmessage.py
schedule_messages
in_servicebus_sender.py
send_messages
in_servicebus_sender.py
schedule_messages
in_servicebus_sender_async.py
send_messages
in_servicebus_sender_async.py
update_queue
,update_topic
,update_subscription
,update_rule
inmanagement/_management_client.py
update_queue
,update_topic
,update_subscription
,update_rule
inaio/management/_management_client_async.py
The text was updated successfully, but these errors were encountered: