Skip to content

Commit

Permalink
Handle null arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
giuseppelillo committed Jan 31, 2024
1 parent 2f9d9cc commit f5bc4cf
Show file tree
Hide file tree
Showing 56 changed files with 70 additions and 61 deletions.
19 changes: 14 additions & 5 deletions codegen/generate_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,14 @@ def generate_entity_array_field(
field: EntityArrayField,
version: int,
) -> str:
optional = (
field.nullableVersions.matches(version) if field.nullableVersions else False
)
field_call = format_array_field_call(field, version)
return f" {to_snake_case(field.name)}: tuple[{field.type}, ...]{field_call}\n"
opt = " | None" if optional else ""
return (
f" {to_snake_case(field.name)}: tuple[{field.type}, ...]{opt}{field_call}\n"
)


def entity_annotation(field: EntityField | CommonStructField, optional: bool) -> str:
Expand Down Expand Up @@ -412,11 +418,14 @@ def generate_common_struct_array_field(
field: CommonStructArrayField,
version: int,
) -> str:
field_call = format_array_field_call(field, version)
return (
f" {to_snake_case(field.name)}: tuple[{field.type.struct.name}, ...]"
f"{field_call}\n"
optional = (
field.nullableVersions.matches(version) if field.nullableVersions else False
)
field_call = format_array_field_call(field, version)
s = f" {to_snake_case(field.name)}: tuple[{field.type.struct.name}, ...]"
if optional:
s = f"{s} | None"
return f"{s}{field_call}\n"


def generate_common_struct_field(
Expand Down
4 changes: 2 additions & 2 deletions src/kio/schema/consumer_group_heartbeat/v0/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class ConsumerGroupHeartbeatRequest:
"""null if it didn't change since the last heartbeat; the subscribed topic regex otherwise"""
server_assignor: str | None = field(metadata={"kafka_type": "string"}, default=None)
"""null if not used or if it didn't change since the last heartbeat; the server side assignor to use otherwise."""
client_assignors: tuple[Assignor, ...]
client_assignors: tuple[Assignor, ...] | None
"""null if not used or if it didn't change since the last heartbeat; the list of client-side assignors otherwise."""
topic_partitions: tuple[TopicPartitions, ...]
topic_partitions: tuple[TopicPartitions, ...] | None
"""null if it didn't change since the last heartbeat; the partitions owned by the member."""
2 changes: 1 addition & 1 deletion src/kio/schema/create_partitions/v0/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CreatePartitionsTopic:
"""The topic name."""
count: i32 = field(metadata={"kafka_type": "int32"})
"""The new partition count."""
assignments: tuple[CreatePartitionsAssignment, ...]
assignments: tuple[CreatePartitionsAssignment, ...] | None
"""The new partition assignments."""


Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/create_partitions/v1/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CreatePartitionsTopic:
"""The topic name."""
count: i32 = field(metadata={"kafka_type": "int32"})
"""The new partition count."""
assignments: tuple[CreatePartitionsAssignment, ...]
assignments: tuple[CreatePartitionsAssignment, ...] | None
"""The new partition assignments."""


Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/create_partitions/v2/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CreatePartitionsTopic:
"""The topic name."""
count: i32 = field(metadata={"kafka_type": "int32"})
"""The new partition count."""
assignments: tuple[CreatePartitionsAssignment, ...]
assignments: tuple[CreatePartitionsAssignment, ...] | None
"""The new partition assignments."""


Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/create_partitions/v3/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CreatePartitionsTopic:
"""The topic name."""
count: i32 = field(metadata={"kafka_type": "int32"})
"""The new partition count."""
assignments: tuple[CreatePartitionsAssignment, ...]
assignments: tuple[CreatePartitionsAssignment, ...] | None
"""The new partition assignments."""


Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/create_topics/v5/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class CreatableTopicResult:
"""Number of partitions of the topic."""
replication_factor: i16 = field(metadata={"kafka_type": "int16"}, default=i16(-1))
"""Replication factor of the topic."""
configs: tuple[CreatableTopicConfigs, ...]
configs: tuple[CreatableTopicConfigs, ...] | None
"""Configuration of the topic."""


Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/create_topics/v6/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class CreatableTopicResult:
"""Number of partitions of the topic."""
replication_factor: i16 = field(metadata={"kafka_type": "int16"}, default=i16(-1))
"""Replication factor of the topic."""
configs: tuple[CreatableTopicConfigs, ...]
configs: tuple[CreatableTopicConfigs, ...] | None
"""Configuration of the topic."""


Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/create_topics/v7/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class CreatableTopicResult:
"""Number of partitions of the topic."""
replication_factor: i16 = field(metadata={"kafka_type": "int16"}, default=i16(-1))
"""Replication factor of the topic."""
configs: tuple[CreatableTopicConfigs, ...]
configs: tuple[CreatableTopicConfigs, ...] | None
"""Configuration of the topic."""


Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/describe_client_quotas/v0/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ class DescribeClientQuotasResponse:
"""The error code, or `0` if the quota description succeeded."""
error_message: str | None = field(metadata={"kafka_type": "string"})
"""The error message, or `null` if the quota description succeeded."""
entries: tuple[EntryData, ...]
entries: tuple[EntryData, ...] | None
"""A result entry."""
2 changes: 1 addition & 1 deletion src/kio/schema/describe_client_quotas/v1/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ class DescribeClientQuotasResponse:
"""The error code, or `0` if the quota description succeeded."""
error_message: str | None = field(metadata={"kafka_type": "string"})
"""The error message, or `null` if the quota description succeeded."""
entries: tuple[EntryData, ...]
entries: tuple[EntryData, ...] | None
"""A result entry."""
2 changes: 1 addition & 1 deletion src/kio/schema/describe_delegation_token/v0/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ class DescribeDelegationTokenRequest:
__flexible__: ClassVar[bool] = False
__api_key__: ClassVar[i16] = i16(41)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
owners: tuple[DescribeDelegationTokenOwner, ...]
owners: tuple[DescribeDelegationTokenOwner, ...] | None
"""Each owner that we want to describe delegation tokens for, or null to describe all tokens."""
2 changes: 1 addition & 1 deletion src/kio/schema/describe_delegation_token/v1/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ class DescribeDelegationTokenRequest:
__flexible__: ClassVar[bool] = False
__api_key__: ClassVar[i16] = i16(41)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
owners: tuple[DescribeDelegationTokenOwner, ...]
owners: tuple[DescribeDelegationTokenOwner, ...] | None
"""Each owner that we want to describe delegation tokens for, or null to describe all tokens."""
2 changes: 1 addition & 1 deletion src/kio/schema/describe_delegation_token/v2/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ class DescribeDelegationTokenRequest:
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(41)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
owners: tuple[DescribeDelegationTokenOwner, ...]
owners: tuple[DescribeDelegationTokenOwner, ...] | None
"""Each owner that we want to describe delegation tokens for, or null to describe all tokens."""
2 changes: 1 addition & 1 deletion src/kio/schema/describe_delegation_token/v3/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ class DescribeDelegationTokenRequest:
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(41)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
owners: tuple[DescribeDelegationTokenOwner, ...]
owners: tuple[DescribeDelegationTokenOwner, ...] | None
"""Each owner that we want to describe delegation tokens for, or null to describe all tokens."""
2 changes: 1 addition & 1 deletion src/kio/schema/describe_log_dirs/v0/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ class DescribeLogDirsRequest:
__flexible__: ClassVar[bool] = False
__api_key__: ClassVar[i16] = i16(35)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
topics: tuple[DescribableLogDirTopic, ...]
topics: tuple[DescribableLogDirTopic, ...] | None
"""Each topic that we want to describe log directories for, or null for all topics."""
2 changes: 1 addition & 1 deletion src/kio/schema/describe_log_dirs/v1/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ class DescribeLogDirsRequest:
__flexible__: ClassVar[bool] = False
__api_key__: ClassVar[i16] = i16(35)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
topics: tuple[DescribableLogDirTopic, ...]
topics: tuple[DescribableLogDirTopic, ...] | None
"""Each topic that we want to describe log directories for, or null for all topics."""
2 changes: 1 addition & 1 deletion src/kio/schema/describe_log_dirs/v2/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ class DescribeLogDirsRequest:
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(35)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
topics: tuple[DescribableLogDirTopic, ...]
topics: tuple[DescribableLogDirTopic, ...] | None
"""Each topic that we want to describe log directories for, or null for all topics."""
2 changes: 1 addition & 1 deletion src/kio/schema/describe_log_dirs/v3/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ class DescribeLogDirsRequest:
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(35)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
topics: tuple[DescribableLogDirTopic, ...]
topics: tuple[DescribableLogDirTopic, ...] | None
"""Each topic that we want to describe log directories for, or null for all topics."""
2 changes: 1 addition & 1 deletion src/kio/schema/describe_log_dirs/v4/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ class DescribeLogDirsRequest:
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(35)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
topics: tuple[DescribableLogDirTopic, ...]
topics: tuple[DescribableLogDirTopic, ...] | None
"""Each topic that we want to describe log directories for, or null for all topics."""
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ class DescribeUserScramCredentialsRequest:
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(50)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
users: tuple[UserName, ...]
users: tuple[UserName, ...] | None
"""The users to describe, or null/empty to describe all users."""
2 changes: 1 addition & 1 deletion src/kio/schema/elect_leaders/v0/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ElectLeadersRequest:
__flexible__: ClassVar[bool] = False
__api_key__: ClassVar[i16] = i16(43)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
topic_partitions: tuple[TopicPartitions, ...]
topic_partitions: tuple[TopicPartitions, ...] | None
"""The topic partitions to elect leaders."""
timeout: i32Timedelta = field(
metadata={"kafka_type": "timedelta_i32"},
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/elect_leaders/v1/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ElectLeadersRequest:
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
election_type: i8 = field(metadata={"kafka_type": "int8"})
"""Type of elections to conduct for the partition. A value of '0' elects the preferred replica. A value of '1' elects the first live replica if there are no in-sync replica."""
topic_partitions: tuple[TopicPartitions, ...]
topic_partitions: tuple[TopicPartitions, ...] | None
"""The topic partitions to elect leaders."""
timeout: i32Timedelta = field(
metadata={"kafka_type": "timedelta_i32"},
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/elect_leaders/v2/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ElectLeadersRequest:
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
election_type: i8 = field(metadata={"kafka_type": "int8"})
"""Type of elections to conduct for the partition. A value of '0' elects the preferred replica. A value of '1' elects the first live replica if there are no in-sync replica."""
topic_partitions: tuple[TopicPartitions, ...]
topic_partitions: tuple[TopicPartitions, ...] | None
"""The topic partitions to elect leaders."""
timeout: i32Timedelta = field(
metadata={"kafka_type": "timedelta_i32"},
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/fetch/v10/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class PartitionData:
"""The last stable offset (or LSO) of the partition. This is the last offset such that the state of all transactional records prior to this offset have been decided (ABORTED or COMMITTED)"""
log_start_offset: i64 = field(metadata={"kafka_type": "int64"}, default=i64(-1))
"""The current log start offset."""
aborted_transactions: tuple[AbortedTransaction, ...]
aborted_transactions: tuple[AbortedTransaction, ...] | None
"""The aborted transactions."""
records: tuple[bytes | None, ...] = field(metadata={"kafka_type": "records"})
"""The record data."""
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/fetch/v11/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class PartitionData:
"""The last stable offset (or LSO) of the partition. This is the last offset such that the state of all transactional records prior to this offset have been decided (ABORTED or COMMITTED)"""
log_start_offset: i64 = field(metadata={"kafka_type": "int64"}, default=i64(-1))
"""The current log start offset."""
aborted_transactions: tuple[AbortedTransaction, ...]
aborted_transactions: tuple[AbortedTransaction, ...] | None
"""The aborted transactions."""
preferred_read_replica: BrokerId = field(
metadata={"kafka_type": "int32"}, default=BrokerId(-1)
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/fetch/v12/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class PartitionData:
)
snapshot_id: SnapshotId = field(metadata={"tag": 2}, default=SnapshotId())
"""In the case of fetching an offset less than the LogStartOffset, this is the end offset and epoch that should be used in the FetchSnapshot request."""
aborted_transactions: tuple[AbortedTransaction, ...]
aborted_transactions: tuple[AbortedTransaction, ...] | None
"""The aborted transactions."""
preferred_read_replica: BrokerId = field(
metadata={"kafka_type": "int32"}, default=BrokerId(-1)
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/fetch/v13/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class PartitionData:
)
snapshot_id: SnapshotId = field(metadata={"tag": 2}, default=SnapshotId())
"""In the case of fetching an offset less than the LogStartOffset, this is the end offset and epoch that should be used in the FetchSnapshot request."""
aborted_transactions: tuple[AbortedTransaction, ...]
aborted_transactions: tuple[AbortedTransaction, ...] | None
"""The aborted transactions."""
preferred_read_replica: BrokerId = field(
metadata={"kafka_type": "int32"}, default=BrokerId(-1)
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/fetch/v14/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class PartitionData:
)
snapshot_id: SnapshotId = field(metadata={"tag": 2}, default=SnapshotId())
"""In the case of fetching an offset less than the LogStartOffset, this is the end offset and epoch that should be used in the FetchSnapshot request."""
aborted_transactions: tuple[AbortedTransaction, ...]
aborted_transactions: tuple[AbortedTransaction, ...] | None
"""The aborted transactions."""
preferred_read_replica: BrokerId = field(
metadata={"kafka_type": "int32"}, default=BrokerId(-1)
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/fetch/v15/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class PartitionData:
)
snapshot_id: SnapshotId = field(metadata={"tag": 2}, default=SnapshotId())
"""In the case of fetching an offset less than the LogStartOffset, this is the end offset and epoch that should be used in the FetchSnapshot request."""
aborted_transactions: tuple[AbortedTransaction, ...]
aborted_transactions: tuple[AbortedTransaction, ...] | None
"""The aborted transactions."""
preferred_read_replica: BrokerId = field(
metadata={"kafka_type": "int32"}, default=BrokerId(-1)
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/fetch/v4/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class PartitionData:
"""The current high water mark."""
last_stable_offset: i64 = field(metadata={"kafka_type": "int64"}, default=i64(-1))
"""The last stable offset (or LSO) of the partition. This is the last offset such that the state of all transactional records prior to this offset have been decided (ABORTED or COMMITTED)"""
aborted_transactions: tuple[AbortedTransaction, ...]
aborted_transactions: tuple[AbortedTransaction, ...] | None
"""The aborted transactions."""
records: tuple[bytes | None, ...] = field(metadata={"kafka_type": "records"})
"""The record data."""
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/fetch/v5/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class PartitionData:
"""The last stable offset (or LSO) of the partition. This is the last offset such that the state of all transactional records prior to this offset have been decided (ABORTED or COMMITTED)"""
log_start_offset: i64 = field(metadata={"kafka_type": "int64"}, default=i64(-1))
"""The current log start offset."""
aborted_transactions: tuple[AbortedTransaction, ...]
aborted_transactions: tuple[AbortedTransaction, ...] | None
"""The aborted transactions."""
records: tuple[bytes | None, ...] = field(metadata={"kafka_type": "records"})
"""The record data."""
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/fetch/v6/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class PartitionData:
"""The last stable offset (or LSO) of the partition. This is the last offset such that the state of all transactional records prior to this offset have been decided (ABORTED or COMMITTED)"""
log_start_offset: i64 = field(metadata={"kafka_type": "int64"}, default=i64(-1))
"""The current log start offset."""
aborted_transactions: tuple[AbortedTransaction, ...]
aborted_transactions: tuple[AbortedTransaction, ...] | None
"""The aborted transactions."""
records: tuple[bytes | None, ...] = field(metadata={"kafka_type": "records"})
"""The record data."""
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/fetch/v7/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class PartitionData:
"""The last stable offset (or LSO) of the partition. This is the last offset such that the state of all transactional records prior to this offset have been decided (ABORTED or COMMITTED)"""
log_start_offset: i64 = field(metadata={"kafka_type": "int64"}, default=i64(-1))
"""The current log start offset."""
aborted_transactions: tuple[AbortedTransaction, ...]
aborted_transactions: tuple[AbortedTransaction, ...] | None
"""The aborted transactions."""
records: tuple[bytes | None, ...] = field(metadata={"kafka_type": "records"})
"""The record data."""
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/fetch/v8/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class PartitionData:
"""The last stable offset (or LSO) of the partition. This is the last offset such that the state of all transactional records prior to this offset have been decided (ABORTED or COMMITTED)"""
log_start_offset: i64 = field(metadata={"kafka_type": "int64"}, default=i64(-1))
"""The current log start offset."""
aborted_transactions: tuple[AbortedTransaction, ...]
aborted_transactions: tuple[AbortedTransaction, ...] | None
"""The aborted transactions."""
records: tuple[bytes | None, ...] = field(metadata={"kafka_type": "records"})
"""The record data."""
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/fetch/v9/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class PartitionData:
"""The last stable offset (or LSO) of the partition. This is the last offset such that the state of all transactional records prior to this offset have been decided (ABORTED or COMMITTED)"""
log_start_offset: i64 = field(metadata={"kafka_type": "int64"}, default=i64(-1))
"""The current log start offset."""
aborted_transactions: tuple[AbortedTransaction, ...]
aborted_transactions: tuple[AbortedTransaction, ...] | None
"""The aborted transactions."""
records: tuple[bytes | None, ...] = field(metadata={"kafka_type": "records"})
"""The record data."""
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/list_partition_reassignments/v0/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ class ListPartitionReassignmentsRequest:
default=i32Timedelta.parse(datetime.timedelta(milliseconds=60000)),
)
"""The time in ms to wait for the request to complete."""
topics: tuple[ListPartitionReassignmentsTopics, ...]
topics: tuple[ListPartitionReassignmentsTopics, ...] | None
"""The topics to list partition reassignments for, or null to list everything."""
2 changes: 1 addition & 1 deletion src/kio/schema/metadata/v1/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ class MetadataRequest:
__flexible__: ClassVar[bool] = False
__api_key__: ClassVar[i16] = i16(3)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
topics: tuple[MetadataRequestTopic, ...]
topics: tuple[MetadataRequestTopic, ...] | None
"""The topics to fetch metadata for."""
2 changes: 1 addition & 1 deletion src/kio/schema/metadata/v10/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class MetadataRequest:
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(3)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
topics: tuple[MetadataRequestTopic, ...]
topics: tuple[MetadataRequestTopic, ...] | None
"""The topics to fetch metadata for."""
allow_auto_topic_creation: bool = field(
metadata={"kafka_type": "bool"}, default=True
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/metadata/v11/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class MetadataRequest:
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(3)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
topics: tuple[MetadataRequestTopic, ...]
topics: tuple[MetadataRequestTopic, ...] | None
"""The topics to fetch metadata for."""
allow_auto_topic_creation: bool = field(
metadata={"kafka_type": "bool"}, default=True
Expand Down
2 changes: 1 addition & 1 deletion src/kio/schema/metadata/v12/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class MetadataRequest:
__flexible__: ClassVar[bool] = True
__api_key__: ClassVar[i16] = i16(3)
__header_schema__: ClassVar[type[RequestHeader]] = RequestHeader
topics: tuple[MetadataRequestTopic, ...]
topics: tuple[MetadataRequestTopic, ...] | None
"""The topics to fetch metadata for."""
allow_auto_topic_creation: bool = field(
metadata={"kafka_type": "bool"}, default=True
Expand Down
Loading

0 comments on commit f5bc4cf

Please sign in to comment.