azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

[EventHub] BUG: send_batch raises incorrect error when assigning non-matching partition_key

Open swathipil opened this issue 3 years ago • 0 comments

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')

swathipil avatar Aug 08 '22 22:08 swathipil