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

haonan pushed a commit to branch rel/0.12
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/0.12 by this push:
     new 4689807  [IOTDB-2152] PyClient: Override __eq__() of TSDataType, 
TSEncoding and Compressor to avoid unexpected comparation behaviour (#4577)
4689807 is described below

commit 4689807bcf3c2abe5fddeafd19bc48f5b8c215a8
Author: Steve Yurong Su <[email protected]>
AuthorDate: Wed Dec 15 13:32:55 2021 +0800

    [IOTDB-2152] PyClient: Override __eq__() of TSDataType, TSEncoding and 
Compressor to avoid unexpected comparation behaviour (#4577)
---
 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