This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch iotdb-2152-0.12
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 2a13c847b2bf4d4c4d5fbf1c944dd5df49982f80
Author: Steve Yurong Su <[email protected]>
AuthorDate: Wed Dec 15 11:52:22 2021 +0800

    [IOTDB-2152] PyClient: Override __eq__() of TSDataType, TSEncoding and 
Compressor to avoid unexpected comparation behaviour
---
 client-py/iotdb/utils/IoTDBConstants.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/client-py/iotdb/utils/IoTDBConstants.py 
b/client-py/iotdb/utils/IoTDBConstants.py
index f053af7..eb2d89c 100644
--- a/client-py/iotdb/utils/IoTDBConstants.py
+++ b/client-py/iotdb/utils/IoTDBConstants.py
@@ -28,6 +28,11 @@ class TSDataType(Enum):
     DOUBLE = 4
     TEXT = 5
 
+    # this method is implemented to avoid the issue reported by:
+    # https://bugs.python.org/issue30545
+    def __eq__(self, other) -> bool:
+        return self.value == other.value
+
 
 @unique
 class TSEncoding(Enum):
@@ -41,6 +46,11 @@ class TSEncoding(Enum):
     REGULAR = 7
     GORILLA = 8
 
+    # this method is implemented to avoid the issue reported by:
+    # https://bugs.python.org/issue30545
+    def __eq__(self, other) -> bool:
+        return self.value == other.value
+
 
 @unique
 class Compressor(Enum):
@@ -52,3 +62,8 @@ class Compressor(Enum):
     PAA = 5
     PLA = 6
     LZ4 = 7
+
+    # this method is implemented to avoid the issue reported by:
+    # https://bugs.python.org/issue30545
+    def __eq__(self, other) -> bool:
+        return self.value == other.value

Reply via email to