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

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

commit ec50bf45e7321ef23415d16c1bc72cbd4b67740c
Author: Steve Yurong Su <[email protected]>
AuthorDate: Wed Dec 15 11:48:24 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 5922dc3..4710d70 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
\ No newline at end of file

Reply via email to