xunliu commented on code in PR #5646:
URL: https://github.com/apache/gravitino/pull/5646#discussion_r1869043083


##########
clients/client-python/gravitino/api/expressions/literals/literals.py:
##########
@@ -0,0 +1,137 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import decimal
+from typing import TypeVar
+from datetime import date, time, datetime
+
+from gravitino.api.expressions.literals.literal import Literal
+from gravitino.api.types.type import Type
+from gravitino.api.types.types import Types
+
+T = TypeVar("T")
+
+
+class LiteralImpl(Literal[T]):
+    """Creates a literal with the given type value."""
+
+    _value: T
+    _data_type: Type
+
+    def __init__(self, value: T, data_type: Type):
+        self._value = value
+        self._data_type = data_type
+
+    def value(self) -> T:
+        return self._value
+
+    def data_type(self) -> Type:
+        return self._data_type
+
+    def __eq__(self, other: object) -> bool:
+        if not isinstance(other, LiteralImpl):
+            return False
+        return (self._value == other._value) and (self._data_type == 
other._data_type)
+
+    def __hash__(self):
+        return hash((self._value, self._data_type))
+
+    def __str__(self):
+        return f"LiteralImpl(value={self._value}, data_type={self._data_type})"
+
+
+class Literals:

Review Comment:
   hi @tengqm I know what you mean.
   We also refer to Iceberg's Python client code style.
   
https://github.com/apache/iceberg-python/blob/main/pyiceberg/table/name_mapping.py
   At present, there are not enough experienced Python engineers in the 
community, which is the result of the best efforts of the community partners.
   We keep the python client code consistent with the java code to ensure that 
the functionality is consistent.
   So I think we didn't modify these codes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to