You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is assigned an inthere (the value is passed in to add_coordinator(...)here, the value of resp.coordinator_id is an integer, as defined here, and here)
Expected behaviour aiokafka.structs.BrokerMetadata#nodeId is correctly typed as a typing.Union[int, str]
Value reads do not seem to care too much about the type of this field, as long as:
It is unique
It can be used as a dict key
So no further changes should be needed
Alternative is to make it a str field, and convert int to str where int values are currently being assigned.
Environment (please complete the following information):
N/A this is a typing bug, I generally use Pyright to type check.
Additional observations
Also note that the name nodeId is camel-case, whereas Python prefers (and the rest of the code-base are) snake-case. I will provide a PR to resolve the above issue shortly. I am happy to rename nodeId to node_id as well, if that is desired, but I do not plan to, to minimize the changes introduced by the PR.
The text was updated successfully, but these errors were encountered:
Describe the bug
aiokafka.structs.BrokerMetadata#nodeId is typed as an
int
, however it is sometimes assignedstr
values:str
herestr
hereint
here (the value is passed in toadd_coordinator(...)
here, the value ofresp.coordinator_id
is an integer, as defined here, and here)Expected behaviour
aiokafka.structs.BrokerMetadata#nodeId
is correctly typed as atyping.Union[int, str]
Value reads do not seem to care too much about the type of this field, as long as:
dict
keySo no further changes should be needed
Alternative is to make it a
str
field, and convertint
tostr
whereint
values are currently being assigned.Environment (please complete the following information):
N/A this is a typing bug, I generally use Pyright to type check.
Additional observations
Also note that the name
nodeId
is camel-case, whereas Python prefers (and the rest of the code-base are) snake-case. I will provide a PR to resolve the above issue shortly. I am happy to renamenodeId
tonode_id
as well, if that is desired, but I do not plan to, to minimize the changes introduced by the PR.The text was updated successfully, but these errors were encountered: