Skip to content
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

invalid Type AioKafkaAdminClient create_partitions #977

Closed
alm0ra opened this issue Feb 11, 2024 · 0 comments · Fixed by #978
Closed

invalid Type AioKafkaAdminClient create_partitions #977

alm0ra opened this issue Feb 11, 2024 · 0 comments · Fixed by #978

Comments

@alm0ra
Copy link
Contributor

alm0ra commented Feb 11, 2024

Describe the bug
there is a type error or wrong type

Environment (please complete the following information):

  • aiokafka version : v0.10.0
  • Kafka Broker version : 7.1.2-ccs (Commit:99a40ee4675ee147)

Reproducible example
in admin/client.py

    @staticmethod
    def _convert_topic_partitions(topic_partitions: Dict[str, TopicPartition]):
        return [(topic_name, (new_part.total_count, new_part.new_assignments))
                for topic_name, new_part in topic_partitions.items()]

while in struct.py TopicPartition defined like this

class TopicPartition(NamedTuple):
    """A topic and partition tuple"""

    topic: str
    "A topic name"

    partition: int
    "A partition id"

and there is no total_count and new_assignments in this type
it must be admin/new_partitions.py

class NewPartitions:
    """A class for new partition creation on existing topics.  Note that the
    length of new_assignments, if specified, must be the difference between the
    new total number of partitions and the existing number of partitions.
    Arguments:
        total_count (int):
            the total number of partitions that should exist on the topic
        new_assignments ([[int]]):
            an array of arrays of replica assignments for new partitions.
            If not set, broker assigns replicas per an internal algorithm.
    """

    def __init__(
        self,
        total_count,
        new_assignments=None
    ):
        self.total_count = total_count
        self.new_assignments = new_assignments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant