Skip to content

Commit 2ee3928

Browse files
authored
Merge pull request #236 from PeterJCLaw/fix-docstring-lists
Format these docstring lists more usefully
2 parents 29383a8 + 6e6fedf commit 2ee3928

File tree

2 files changed

+39
-33
lines changed

2 files changed

+39
-33
lines changed

mockafka/admin_client.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,22 @@ class FakeAdminClientImpl:
2121
- kafka (KafkaStore): The in-memory storage for simulating Kafka behavior.
2222
- clean (bool): Flag indicating whether to start with a clean slate.
2323
24-
Methods: - create_partitions(partitions: List[NewPartitions]): Create partitions in the in-memory Kafka store. -
25-
create_partition(partition: NewPartitions): Create a single partition in the in-memory Kafka store. -
26-
create_topics(topics: List[NewTopic]): Create topics in the in-memory Kafka store. - create_topic(topic:
27-
NewTopic): Create a single topic in the in-memory Kafka store. - delete_topics(topics, future=None,
28-
request_timeout=None, operation_timeout=None): Delete topics from the in-memory Kafka store. - delete_topic(
29-
topic: NewTopic): Delete a single topic from the in-memory Kafka store. - describe_acls(acl_binding_filter,
30-
future, request_timeout=None): Describe ACLs (unsupported in mockafka). - describe_configs(resources, future,
31-
request_timeout=None, broker=None): Describe configurations (unsupported in mockafka). - delete_acls(
32-
acl_binding_filters, future, request_timeout=None): Delete ACLs (unsupported in mockafka). - alter_configs(*args,
33-
**kwargs): Alter configurations (unsupported in mockafka). - create_acls(*args, **kwargs): Create ACLs (
34-
unsupported in mockafka). - list_groups(group=None, *args, **kwargs): List consumer groups (unsupported in
35-
mockafka). - list_topics(topic=None, *args, **kwargs): List topics (returns ClusterMetadata). - poll(
36-
timeout=None): Poll for events (unsupported in mockafka). - __len__(*args, **kwargs): Get the length of the Kafka
37-
store (not implemented).
24+
Methods:
25+
- create_partitions(partitions: List[NewPartitions]): Create partitions in the in-memory Kafka store.
26+
- create_partition(partition: NewPartitions): Create a single partition in the in-memory Kafka store.
27+
- create_topics(topics: List[NewTopic]): Create topics in the in-memory Kafka store.
28+
- create_topic(topic: NewTopic): Create a single topic in the in-memory Kafka store.
29+
- delete_topics(topics, future=None, request_timeout=None, operation_timeout=None): Delete topics from the in-memory Kafka store.
30+
- delete_topic(topic: NewTopic): Delete a single topic from the in-memory Kafka store.
31+
- describe_acls(acl_binding_filter, future, request_timeout=None): Describe ACLs (unsupported in mockafka).
32+
- describe_configs(resources, future, request_timeout=None, broker=None): Describe configurations (unsupported in mockafka).
33+
- delete_acls(acl_binding_filters, future, request_timeout=None): Delete ACLs (unsupported in mockafka).
34+
- alter_configs(*args, **kwargs): Alter configurations (unsupported in mockafka).
35+
- create_acls(*args, **kwargs): Create ACLs (unsupported in mockafka).
36+
- list_groups(group=None, *args, **kwargs): List consumer groups (unsupported in mockafka).
37+
- list_topics(topic=None, *args, **kwargs): List topics (returns ClusterMetadata).
38+
- poll(timeout=None): Poll for events (unsupported in mockafka).
39+
- __len__(*args, **kwargs): Get the length of the Kafka store (not implemented).
3840
"""
3941

4042
def __init__(self, clean: bool = False, *args: Any, **kwargs) -> None:

mockafka/consumer.py

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,29 @@ class FakeConsumer(object):
2020
- consumer_store (dict): Dictionary to store consumer offsets for each topic-partition.
2121
- subscribed_topic (list): List of topics subscribed by the consumer.
2222
23-
Methods: - consume(num_messages=1, *args, **kwargs): Consume messages from subscribed topics. - close(*args,
24-
**kwargs): Close the consumer and reset state. - commit(message: Message = None, *args, **kwargs): Commit offsets
25-
for consumed messages. - list_topics(topic=None, *args, **kwargs): List topics (returns ClusterMetadata). - poll(
26-
timeout=None): Poll for messages from subscribed topics. - _get_key(topic, partition) -> str: Generate a unique
27-
key for a topic-partition pair. - subscribe(topics, on_assign=None, *args, **kwargs): Subscribe to one or more
28-
topics. - unsubscribe(*args, **kwargs): Unsubscribe from one or more topics. - assign(partitions): Assign
29-
partitions to the consumer (unsupported in mockafka). - unassign(*args, **kwargs): Unassign partitions (
30-
unsupported in mockafka). - assignment(*args, **kwargs) -> list: Get assigned partitions (unsupported in
31-
mockafka). - committed(partitions, timeout=None) -> list: Get committed offsets (unsupported in mockafka). -
32-
get_watermark_offsets(partition, timeout=None, *args, **kwargs) -> tuple: Get watermark offsets (unsupported in
33-
mockafka). - offsets_for_times(partitions, timeout=None) -> list: Get offsets for given times (unsupported in
34-
mockafka). - pause(partitions) -> None: Pause consumption from specified partitions (unsupported in mockafka). -
35-
position(partitions) -> list: Get the current position of the consumer in specified partitions (unsupported in
36-
mockafka). - resume(partitions) -> None: Resume consumption from specified partitions (unsupported in mockafka).
37-
- seek(partition) -> None: Seek to a specific offset in a partition (unsupported in mockafka). - store_offsets(
38-
message=None, *args, **kwargs) -> None: Store offsets for consumed messages (unsupported in mockafka). -
39-
consumer_group_metadata() -> None: Get consumer group metadata (unsupported in mockafka). - incremental_assign(
40-
partitions) -> None: Incrementally assign partitions (unsupported in mockafka). - incremental_unassign(
41-
partitions) -> None: Incrementally unassign partitions (unsupported in mockafka).
23+
Methods:
24+
- consume(num_messages=1, *args, **kwargs): Consume messages from subscribed topics.
25+
- close(*args, **kwargs): Close the consumer and reset state.
26+
- commit(message: Message = None, *args, **kwargs): Commit offsets for consumed messages.
27+
- list_topics(topic=None, *args, **kwargs): List topics (returns ClusterMetadata).
28+
- poll(timeout=None): Poll for messages from subscribed topics.
29+
- _get_key(topic, partition) -> str: Generate a unique key for a topic-partition pair.
30+
- subscribe(topics, on_assign=None, *args, **kwargs): Subscribe to one or more topics.
31+
- unsubscribe(*args, **kwargs): Unsubscribe from one or more topics.
32+
- assign(partitions): Assign partitions to the consumer (unsupported in mockafka).
33+
- unassign(*args, **kwargs): Unassign partitions (unsupported in mockafka).
34+
- assignment(*args, **kwargs) -> list: Get assigned partitions (unsupported in mockafka).
35+
- committed(partitions, timeout=None) -> list: Get committed offsets (unsupported in mockafka).
36+
- get_watermark_offsets(partition, timeout=None, *args, **kwargs) -> tuple: Get watermark offsets (unsupported in mockafka).
37+
- offsets_for_times(partitions, timeout=None) -> list: Get offsets for given times (unsupported in mockafka).
38+
- pause(partitions) -> None: Pause consumption from specified partitions (unsupported in mockafka).
39+
- position(partitions) -> list: Get the current position of the consumer in specified partitions (unsupported in mockafka).
40+
- resume(partitions) -> None: Resume consumption from specified partitions (unsupported in mockafka).
41+
- seek(partition) -> None: Seek to a specific offset in a partition (unsupported in mockafka).
42+
- store_offsets(message=None, *args, **kwargs) -> None: Store offsets for consumed messages (unsupported in mockafka).
43+
- consumer_group_metadata() -> None: Get consumer group metadata (unsupported in mockafka).
44+
- incremental_assign(partitions) -> None: Incrementally assign partitions (unsupported in mockafka).
45+
- incremental_unassign(partitions) -> None: Incrementally unassign partitions (unsupported in mockafka).
4246
"""
4347

4448
def __init__(self, *args: Any, **kwargs: Any) -> None:

0 commit comments

Comments
 (0)