Skip to content
Open
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
10 changes: 0 additions & 10 deletions stubs/kafka-python/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,3 @@ kafka.*\.__license__

# The max_version param expects an int, even though it has as default value of float('inf').
kafka.protocol.broker_version_data.BrokerVersionData.api_version

# TODO: This has more attributes.
kafka.protocol.api_header.RequestHeader.client_id
kafka.protocol.api_header.RequestHeader.correlation_id
kafka.protocol.api_header.RequestHeader.request_api_key
kafka.protocol.api_header.RequestHeader.request_api_version
kafka.protocol.api_header.ResponseHeader.correlation_id
kafka.coordinator.assignors.sticky.user_data.StickyAssignorUserData.TopicPartition
kafka.coordinator.assignors.sticky.user_data.StickyAssignorUserData.generation
kafka.coordinator.assignors.sticky.user_data.StickyAssignorUserData.previous_assignment
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from kafka.protocol.api_data import ApiData
from kafka.protocol.data_container import DataContainer

class StickyAssignorUserData(ApiData):
class TopicPartition(DataContainer):
topic: str
partitions: list[int]

previous_assignment: list[TopicPartition]
generation: int
Comment on lines +5 to +10

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do the nested class and attributes come from? This warrants at least a short comment.

def __init__(self, *args, **kw) -> None: ...
# TODO: Reflect TopicPartition, generation, previous_assignment attributes
def __getattr__(self, name: str): ... # incomplete class
9 changes: 5 additions & 4 deletions stubs/kafka-python/kafka/protocol/api_header.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ class ResponseClassRegistry:
def get_response_class(cls, request_header): ...

class RequestHeader(ApiHeader):
request_api_key: int
request_api_version: int
correlation_id: int
client_id: str | None
Comment on lines +19 to +22

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

def get_response_class(self): ...
# TODO: Reflect client_id, correlation_id, request_api_key, request_api_version attributes
def __getattr__(self, name: str): ... # incomplete class

class ResponseHeader(ApiHeader):
# TODO: Reflect correlation_id attribute
def __getattr__(self, name: str): ... # incomplete class
correlation_id: int

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here.

Loading