azure-sdk-for-python
azure-sdk-for-python copied to clipboard
[EventHub] BUG: send_batch raises incorrect error when assigning non-matching partition_key
When trying to re-send a received event with a partition key by calling producer.send_batch and passing in a non-matching partition key, the error raised should be [this one] and not [this one]. However, the error with the following message is being raised:
To reproduce, run recv.py with on_event set as the following and pass in a producer client:
def on_event(partition_context, event):
print("Received event from partition: {}.".format(partition_context.partition_id))
if event.partition_key:
print(event.partition_key)
producer.send_batch([event], partition_key=b'hello')