From 49a557334584b5a09e96e78609b111777e14b2fb Mon Sep 17 00:00:00 2001 From: Jack Leow Date: Fri, 15 Nov 2024 23:20:53 -0800 Subject: [PATCH] Updated BrokerMetadata#nodeId type from `int` to `int | str`. (#1051) * Updated BrokerMetadata#nodeId type from int to (int | str). * FIXME. * Unused import. * Include issue link in FIXME. * Fix linter errors --------- Co-authored-by: Denis Otkidach --- aiokafka/structs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aiokafka/structs.py b/aiokafka/structs.py index 3db1d20a..8c836e39 100644 --- a/aiokafka/structs.py +++ b/aiokafka/structs.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Sequence from dataclasses import dataclass from typing import Generic, NamedTuple, Optional, TypeVar @@ -27,7 +29,8 @@ class TopicPartition(NamedTuple): class BrokerMetadata(NamedTuple): """A Kafka broker metadata used by admin tools""" - nodeId: int + # FIXME: consider updating implementation (https://github.com/aio-libs/aiokafka/issues/1050) + nodeId: int | str "The Kafka broker id" host: str