Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fix for missing annotation initialization #7575

Merged
merged 1 commit into from
Oct 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/eventhub/azure-eventhubs/azure/eventhub/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def __init__(self, body=None):
raise ValueError("EventData cannot be None.")
else:
self.message = Message(body)
self.message.annotations = {}

def __str__(self):
dic = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,15 @@ async def test_send_with_create_event_batch_async(connstr_receivers):
client = EventHubClient.from_connection_string(connection_str, transport_type=TransportType.AmqpOverWebsocket, network_tracing=False)
sender = client.create_producer()

event_data_batch = await sender.create_batch(max_size=100000, partition_key="0")
while True:
try:
event_data_batch.try_add(EventData('A single event data'))
except ValueError:
break

await sender.send(event_data_batch)

event_data_batch = await sender.create_batch(max_size=100000)
while True:
try:
Expand Down
9 changes: 9 additions & 0 deletions sdk/eventhub/azure-eventhubs/tests/test_send.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,15 @@ def test_send_with_create_event_batch_sync(connstr_receivers):
client = EventHubClient.from_connection_string(connection_str, transport_type=TransportType.AmqpOverWebsocket, network_tracing=False)
sender = client.create_producer()

event_data_batch = sender.create_batch(max_size=100000, partition_key="0")
while True:
try:
event_data_batch.try_add(EventData('A single event data'))
except ValueError:
break

sender.send(event_data_batch)

event_data_batch = sender.create_batch(max_size=100000)
while True:
try:
Expand Down