From 12e9f1d631f56ed7d797ca69259dcc13b9bb175f Mon Sep 17 00:00:00 2001 From: Commelina Date: Thu, 26 Dec 2024 04:43:12 +0200 Subject: [PATCH] scripts: handle `float64` and totally same type definitions in kafka_gen.py --- script/kafka_gen.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/script/kafka_gen.py b/script/kafka_gen.py index d5bd52a9e..cf6a6c27e 100755 --- a/script/kafka_gen.py +++ b/script/kafka_gen.py @@ -54,6 +54,7 @@ "int32": "{{-# UNPACK #-}} !Int32", "int16": "{{-# UNPACK #-}} !Int16", "int64": "{{-# UNPACK #-}} !Int64", + "float64": "{{-# UNPACK #-}} !Double", "string": "!Text", "bool": "Bool", "bytes": "!ByteString", @@ -131,6 +132,9 @@ def get_field_default(field_type, default=None): "DescribeGroups": (0, 1), "FindCoordinator": (0, 1), "CreatePartitions": (0, 1), + "CreateAcls": (0, 1), + "DeleteAcls": (0, 1), + "DescribeAcls": (0, 1) } # ----------------------------------------------------------------------------- @@ -306,10 +310,11 @@ def format(self): def append_hs_datas(datas: List[HsData], data: HsData): same_found = False + totally_same_found = False for data_ in datas: if data.name == data_.name: - # The same data_name should not has the same version - assert data.version != data_.version + if (data.version == data_.version and data.fields == data_.fields): + totally_same_found = True # Use the first same type is OK if ( @@ -322,8 +327,10 @@ def append_hs_datas(datas: List[HsData], data: HsData): f"{data.name}V{data_.version}" ) data.fields = data_.version + same_found = True - datas.append(data) + if (not totally_same_found): + datas.append(data) # -----------------------------------------------------------------------------