You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2021/12/15 05:33:10 UTC

[iotdb] branch master updated: [IOTDB-2152] PyClient: Override __eq__() of TSDataType, TSEncoding and Compressor to avoid unexpected comparation behaviour (#4576)

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

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


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

commit ff669ed4397dd897e64af59d744f0ef22a63570e
Author: Steve Yurong Su <ro...@apache.org>
AuthorDate: Wed Dec 15 13:32:36 2021 +0800

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