Skip to content

[EventHubs] Warning partition key type #16909

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

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ def send_batch(self, event_data_batch, **kwargs):
A `TypeError` will be raised if partition_key is specified and event_data_batch is an `EventDataBatch` because
`EventDataBatch` itself has partition_key.
If both partition_id and partition_key are provided, the partition_id will take precedence.
**WARNING: Please DO NOT pass a partition_key of non-string type. The Event Hub service ignores partition_key
of non-string type, in which case events will be assigned to all partitions using round-robin.**
:rtype: None
:raises: :class:`AuthenticationError<azure.eventhub.exceptions.AuthenticationError>`
:class:`ConnectError<azure.eventhub.exceptions.ConnectError>`
Expand Down Expand Up @@ -277,6 +279,8 @@ def create_batch(self, **kwargs):
:keyword str partition_key: With the given partition_key, event data will be sent to
a particular partition of the Event Hub decided by the service.
If both partition_id and partition_key are provided, the partition_id will take precedence.
**WARNING: Please DO NOT pass a partition_key of non-string type. The Event Hub service ignores partition_key
of non-string type, in which case events will be assigned to all partitions using round-robin.**
:keyword int max_size_in_bytes: The maximum size of bytes data that an EventDataBatch object can hold. By
default, the value is determined by your Event Hubs tier.
:rtype: ~azure.eventhub.EventDataBatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ async def send_batch(
A `TypeError` will be raised if partition_key is specified and event_data_batch is an `EventDataBatch` because
`EventDataBatch` itself has partition_key.
If both partition_id and partition_key are provided, the partition_id will take precedence.
**WARNING: Please DO NOT pass a partition_key of non-string type. The Event Hub service ignores partition_key
of non-string type, in which case events will be assigned to all partitions using round-robin.**
:rtype: None
:raises: :class:`AuthenticationError<azure.eventhub.exceptions.AuthenticationError>`
:class:`ConnectError<azure.eventhub.exceptions.ConnectError>`
Expand Down Expand Up @@ -313,6 +315,8 @@ async def create_batch(
:param str partition_key: With the given partition_key, event data will be sent to
a particular partition of the Event Hub decided by the service.
If both partition_id and partition_key are provided, the partition_id will take precedence.
**WARNING: Please DO NOT pass a partition_key of non-string type. The Event Hub service ignores partition_key
of non-string type, in which case events will be assigned to all partitions using round-robin.**
:param int max_size_in_bytes: The maximum size of bytes data that an EventDataBatch object can hold. By
default, the value is determined by your Event Hubs tier.
:rtype: ~azure.eventhub.EventDataBatch
Expand Down