Skip to content

Commit 55b1d2e

Browse files
authored
[EH] strict sphinx (#34062)
* strict sphinx * remove until mgmt packages arent checked * checkpointstoretable strcit_sphinx
1 parent 10d5d65 commit 55b1d2e

File tree

5 files changed

+107
-87
lines changed

5 files changed

+107
-87
lines changed

sdk/eventhub/azure-eventhub-checkpointstoretable/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
Azure EventHubs Checkpoint Store is used for storing checkpoints while processing events from Azure Event Hubs.
66
This Checkpoint Store package works as a plug-in package to `EventHubConsumerClient`. It uses Azure Tables as the persistent store for maintaining checkpoints and partition ownership information.
77

8+
9+
# Getting started
10+
811
## _Disclaimer_
912

1013
_Azure SDK Python packages support for Python 2.7 is ending 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
1114

12-
# Getting started
13-
1415
### Prerequisites
1516

1617
- Python2.7, Python 3.6 or later.

sdk/eventhub/azure-eventhub-checkpointstoretable/azure/eventhub/extensions/checkpointstoretable/_tablestoragecs.py

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,16 @@ def list_ownership(
226226
relative to the Event Hubs namespace that contains it.
227227
:param str consumer_group: The name of the consumer group the ownerships are associated with.
228228
:rtype: Iterable[Dict[str, Any]], Iterable of dictionaries containing partition ownership information:
229-
- `fully_qualified_namespace` (str): The fully qualified namespace that the Event Hub belongs to.
230-
The format is like "<namespace>.servicebus.windows.net".
231-
- `eventhub_name` (str): The name of the specific Event Hub the checkpoint is associated with,
232-
relative to the Event Hubs namespace that contains it.
233-
- `consumer_group` (str): The name of the consumer group the ownership are associated with.
234-
- `partition_id` (str): The partition ID which the checkpoint is created for.
235-
- `owner_id` (str): A UUID representing the current owner of this partition.
236-
- `last_modified_time` (float): The last time this ownership was claimed.
237-
- `etag` (str): The Etag value for the last time this ownership was modified. Optional depending
238-
on storage implementation.
229+
- `fully_qualified_namespace` (str): The fully qualified namespace that the Event Hub belongs to.
230+
The format is like "<namespace>.servicebus.windows.net".
231+
- `eventhub_name` (str): The name of the specific Event Hub the checkpoint is associated with,
232+
relative to the Event Hubs namespace that contains it.
233+
- `consumer_group` (str): The name of the consumer group the ownership are associated with.
234+
- `partition_id` (str): The partition ID which the checkpoint is created for.
235+
- `owner_id` (str): A UUID representing the current owner of this partition.
236+
- `last_modified_time` (float): The last time this ownership was claimed.
237+
- `etag` (str): The Etag value for the last time this ownership was modified. Optional depending
238+
on storage implementation.
239239
"""
240240
try:
241241
partition_key = "{} {} {} Ownership".format(
@@ -282,14 +282,14 @@ def list_checkpoints(
282282
the Event Hubs namespace that contains it.
283283
:param str consumer_group: The name of the consumer group the checkpoints are associated with.
284284
:rtype: Iterable[Dict[str,Any]], Iterable of dictionaries containing partition checkpoint information:
285-
- `fully_qualified_namespace` (str): The fully qualified namespace that the Event Hub belongs to.
286-
The format is like "<namespace>.servicebus.windows.net".
287-
- `eventhub_name` (str): The name of the specific Event Hub the checkpoints are associated with,
288-
relative to the Event Hubs namespace that contains it.
289-
- `consumer_group` (str): The name of the consumer group the checkpoints are associated with.
290-
- `partition_id` (str): The partition ID which the checkpoint is created for.
291-
- `sequence_number` (int): The sequence number of the :class:`EventData<azure.eventhub.EventData>`.
292-
- `offset` (str): The offset of the :class:`EventData<azure.eventhub.EventData>`.
285+
- `fully_qualified_namespace` (str): The fully qualified namespace that the Event Hub belongs to.
286+
The format is like "<namespace>.servicebus.windows.net".
287+
- `eventhub_name` (str): The name of the specific Event Hub the checkpoints are associated with,
288+
relative to the Event Hubs namespace that contains it.
289+
- `consumer_group` (str): The name of the consumer group the checkpoints are associated with.
290+
- `partition_id` (str): The partition ID which the checkpoint is created for.
291+
- `sequence_number` (int): The sequence number of the :class:`EventData<azure.eventhub.EventData>`.
292+
- `offset` (str): The offset of the :class:`EventData<azure.eventhub.EventData>`.
293293
"""
294294
partition_key = "{} {} {} Checkpoint".format(
295295
fully_qualified_namespace, eventhub_name, consumer_group
@@ -317,16 +317,17 @@ def update_checkpoint(self, checkpoint, **kwargs):
317317
Note: If you plan to implement a custom checkpoint store with the intention of running between
318318
cross-language EventHubs SDKs, it is recommended to persist the offset value as an integer.
319319
:param Dict[str,Any] checkpoint: A dict containing checkpoint information:
320-
- `fully_qualified_namespace` (str): The fully qualified namespace that the Event Hub belongs to.
321-
The format is like "<namespace>.servicebus.windows.net".
322-
- `eventhub_name` (str): The name of the specific Event Hub the checkpoint is associated with,
323-
relative to the Event Hubs namespace that contains it.
324-
- `consumer_group` (str): The name of the consumer group the checkpoint is associated with.
325-
- `partition_id` (str): The partition ID which the checkpoint is created for.
326-
- `sequence_number` (int): The sequence number of the :class:`EventData<azure.eventhub.EventData>`
327-
the new checkpoint will be associated with.
328-
- `offset` (str): The offset of the :class:`EventData<azure.eventhub.EventData>`
329-
the new checkpoint will be associated with.
320+
- `fully_qualified_namespace` (str): The fully qualified namespace that the Event Hub belongs to.
321+
The format is like "<namespace>.servicebus.windows.net".
322+
- `eventhub_name` (str): The name of the specific Event Hub the checkpoint is associated with,
323+
relative to the Event Hubs namespace that contains it.
324+
- `consumer_group` (str): The name of the consumer group the checkpoint is associated with.
325+
- `partition_id` (str): The partition ID which the checkpoint is created for.
326+
- `sequence_number` (int): The sequence number of the :class:`EventData<azure.eventhub.EventData>`
327+
the new checkpoint will be associated with.
328+
- `offset` (str): The offset of the :class:`EventData<azure.eventhub.EventData>`
329+
the new checkpoint will be associated with.
330+
330331
:rtype: None
331332
"""
332333
checkpoint_entity = TableCheckpointStore._create_checkpoint_entity(
@@ -355,16 +356,16 @@ def claim_ownership(self, ownership_list, **kwargs):
355356
356357
:param Iterable[Dict[str,Any]] ownership_list: Iterable of dictionaries containing all the ownerships to claim.
357358
:rtype: Iterable[Dict[str,Any]], Iterable of dictionaries containing partition ownership information:
358-
- `fully_qualified_namespace` (str): The fully qualified namespace that the Event Hub belongs to.
359-
The format is like "<namespace>.servicebus.windows.net".
360-
- `eventhub_name` (str): The name of the specific Event Hub the checkpoint is associated with,
361-
relative to the Event Hubs namespace that contains it.
362-
- `consumer_group` (str): The name of the consumer group the ownership are associated with.
363-
- `partition_id` (str): The partition ID which the checkpoint is created for.
364-
- `owner_id` (str): A UUID representing the owner attempting to claim this partition.
365-
- `last_modified_time` (float): The last time this ownership was claimed.
366-
- `etag` (str): The Etag value for the last time this ownership was modified. Optional depending
367-
on storage implementation.
359+
- `fully_qualified_namespace` (str): The fully qualified namespace that the Event Hub belongs to.
360+
The format is like "<namespace>.servicebus.windows.net".
361+
- `eventhub_name` (str): The name of the specific Event Hub the checkpoint is associated with,
362+
relative to the Event Hubs namespace that contains it.
363+
- `consumer_group` (str): The name of the consumer group the ownership are associated with.
364+
- `partition_id` (str): The partition ID which the checkpoint is created for.
365+
- `owner_id` (str): A UUID representing the owner attempting to claim this partition.
366+
- `last_modified_time` (float): The last time this ownership was claimed.
367+
- `etag` (str): The Etag value for the last time this ownership was modified. Optional depending
368+
on storage implementation.
368369
"""
369370
gathered_results = []
370371
for x in ownership_list:

sdk/eventhub/azure-eventhub/azure/eventhub/_constants.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767
class TransportType(Enum):
6868
"""Transport type
6969
The underlying transport protocol type:
70-
Amqp: AMQP over the default TCP transport protocol, it uses port 5671.
71-
AmqpOverWebsocket: Amqp over the Web Sockets transport protocol, it uses
72-
port 443.
70+
Amqp: AMQP over the default TCP transport protocol, it uses port 5671.
71+
AmqpOverWebsocket: Amqp over the Web Sockets transport protocol, it uses
72+
port 443.
7373
"""
7474
Amqp = 1
7575
AmqpOverWebsocket = 2

sdk/eventhub/azure-eventhub/azure/eventhub/_producer_client.py

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,28 @@ class EventHubProducerClient(
6363
:paramtype buffer_concurrency: ThreadPoolExecutor or int or None
6464
:keyword on_success: The callback to be called once a batch has been successfully published.
6565
The callback takes two parameters:
66-
- `events`: The list of events that have been successfully published
67-
- `partition_id`: The partition id that the events in the list have been published to.
66+
- `events`: The list of events that have been successfully published
67+
- `partition_id`: The partition id that the events in the list have been published to.
68+
6869
The callback function should be defined like: `on_success(events, partition_id)`.
6970
It is required when `buffered_mode` is True while optional if `buffered_mode` is False.
7071
:paramtype on_success: Optional[Callable[[SendEventTypes, Optional[str]], None]]
7172
:keyword on_error: The callback to be called once a batch has failed to be published.
7273
The callback function should be defined like: `on_error(events, partition_id, error)`, where:
73-
- `events`: The list of events that failed to be published,
74-
- `partition_id`: The partition id that the events in the list have been tried to be published to and
75-
- `error`: The exception related to the sending failure.
74+
- `events`: The list of events that failed to be published,
75+
- `partition_id`: The partition id that the events in the list have been tried to be published to and
76+
- `error`: The exception related to the sending failure.
77+
7678
If `buffered_mode` is False, `on_error` callback is optional and errors will be handled as follows:
77-
- If an `on_error` callback is passed during the producer client instantiation,
78-
then error information will be passed to the `on_error` callback, which will then be called.
79-
- If an `on_error` callback is not passed in during client instantiation,
80-
then the error will be raised by default.
79+
- If an `on_error` callback is passed during the producer client instantiation,
80+
then error information will be passed to the `on_error` callback, which will then be called.
81+
- If an `on_error` callback is not passed in during client instantiation,
82+
then the error will be raised by default.
83+
8184
If `buffered_mode` is True, `on_error` callback is required and errors will be handled as follows:
82-
- If events fail to enqueue within the given timeout, then an error will be directly raised.
83-
- If events fail to send after enqueuing successfully, the `on_error` callback will be called.
85+
- If events fail to enqueue within the given timeout, then an error will be directly raised.
86+
- If events fail to send after enqueuing successfully, the `on_error` callback will be called.
87+
8488
:paramtype on_error: Optional[Callable[[SendEventTypes, Optional[str], Exception], None]]
8589
:keyword int max_buffer_length: Buffered mode only.
8690
The total number of events per partition that can be buffered before a flush will be triggered.
@@ -444,25 +448,29 @@ def from_connection_string(
444448
:paramtype buffer_concurrency: ThreadPoolExecutor or int or None
445449
:keyword on_success: The callback to be called once a batch has been successfully published.
446450
The callback takes two parameters:
447-
- `events`: The list of events that have been successfully published
448-
- `partition_id`: The partition id that the events in the list have been published to.
451+
- `events`: The list of events that have been successfully published
452+
- `partition_id`: The partition id that the events in the list have been published to.
453+
449454
The callback function should be defined like: `on_success(events, partition_id)`.
450455
Required when `buffered_mode` is True while optional if `buffered_mode` is False.
451456
:paramtype on_success: Optional[Callable[[SendEventTypes, Optional[str]], None]]
452457
:keyword on_error: The callback to be called once a batch has failed to be published.
453458
Required when in `buffered_mode` is True while optional if `buffered_mode` is False.
454459
The callback function should be defined like: `on_error(events, partition_id, error)`, where:
455-
- `events`: The list of events that failed to be published,
456-
- `partition_id`: The partition id that the events in the list have been tried to be published to and
457-
- `error`: The exception related to the sending failure.
460+
- `events`: The list of events that failed to be published,
461+
- `partition_id`: The partition id that the events in the list have been tried to be published to and
462+
- `error`: The exception related to the sending failure.
463+
458464
If `buffered_mode` is False, `on_error` callback is optional and errors will be handled as follows:
459-
- If an `on_error` callback is passed during the producer client instantiation,
460-
then error information will be passed to the `on_error` callback, which will then be called.
461-
- If an `on_error` callback is not passed in during client instantiation,
462-
then the error will be raised by default.
465+
- If an `on_error` callback is passed during the producer client instantiation,
466+
then error information will be passed to the `on_error` callback, which will then be called.
467+
- If an `on_error` callback is not passed in during client instantiation,
468+
then the error will be raised by default.
469+
463470
If `buffered_mode` is True, `on_error` callback is required and errors will be handled as follows:
464-
- If events fail to enqueue within the given timeout, then an error will be directly raised.
465-
- If events fail to send after enqueuing successfully, the `on_error` callback will be called.
471+
- If events fail to enqueue within the given timeout, then an error will be directly raised.
472+
- If events fail to send after enqueuing successfully, the `on_error` callback will be called.
473+
466474
:paramtype on_error: Optional[Callable[[SendEventTypes, Optional[str], Exception], None]]
467475
:keyword int max_buffer_length: Buffered mode only.
468476
The total number of events per partition that can be buffered before a flush will be triggered.
@@ -746,6 +754,7 @@ def create_batch(self, **kwargs: Any) -> EventDataBatch:
746754
:language: python
747755
:dedent: 4
748756
:caption: Create EventDataBatch object within limited size
757+
749758
:rtype: ~azure.eventhub.EventDataBatch
750759
"""
751760
if not self._max_message_size_on_link:

0 commit comments

Comments
 (0)