Abyss-lord commented on code in PR #9242:
URL: https://github.com/apache/gravitino/pull/9242#discussion_r2588108084


##########
clients/client-python/gravitino/api/tag/tag_change.py:
##########
@@ -0,0 +1,144 @@
+# 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.
+
+
+from __future__ import annotations
+
+from abc import ABC
+from dataclasses import dataclass, field
+
+from dataclasses_json import config
+
+
+class TagChange(ABC):
+    """Interface for supporting tag changes.
+    This interface will be used to provide tag modification operations for 
each tag."""
+
+    @staticmethod
+    def rename(new_name: str) -> RenameTag:

Review Comment:
   @unknowntpo Thanks for the comment! I understand the intention to align the 
Python API with the Java API.
   However, inheriting the inner concrete classes (e.g., `RenameTag`) from 
`TagChange` is not feasible in Python due to language constraints: Python does 
not allow an inner class to subclass its outer class, as the outer class is not 
fully defined at the time of parsing. This leads to circular reference and 
results in a `NameError`.
   
   In addition, other similar modules in the Python client (for example, 
`model_change`) also do not return `ModelChange` as a concrete subclass, so the 
current pattern is consistent with existing implementations.
   
   So I believe we should keep the current implementation.
   
   
https://github.com/apache/gravitino/blob/7d674098ec5da625e920a22707f3c6bd5a186e29/clients/client-python/gravitino/api/model_change.py#L38



-- 
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