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


##########
clients/client-python/gravitino/dto/requests/table_update_request.py:
##########
@@ -0,0 +1,952 @@
+# 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
+
+import builtins
+import typing
+from abc import ABC, abstractmethod
+from dataclasses import dataclass, field
+
+from dataclasses_json import config, dataclass_json
+
+from gravitino.api.rel.expressions.expression import Expression
+from gravitino.api.rel.indexes.index import Index
+from gravitino.api.rel.indexes.indexes import Indexes
+from gravitino.api.rel.table_change import (
+    DeleteColumn,
+    RenameColumn,
+    TableChange,
+    UpdateColumnAutoIncrement,
+    UpdateColumnComment,
+    UpdateColumnDefaultValue,
+    UpdateColumnNullability,
+    UpdateColumnPosition,
+    UpdateColumnType,
+)
+from gravitino.api.rel.types.json_serdes import TypeSerdes
+from gravitino.api.rel.types.type import Type
+from gravitino.dto.rel.expressions.json_serdes.column_default_value_serdes 
import (
+    ColumnDefaultValueSerdes,
+)
+from gravitino.dto.rel.indexes.json_serdes.index_serdes import IndexSerdes
+from gravitino.dto.rel.json_serdes.column_position_serdes import 
ColumnPositionSerdes
+from gravitino.rest.rest_message import RESTRequest
+from gravitino.utils import StringUtils
+from gravitino.utils.precondition import Precondition
+
+
+@dataclass_json
+@dataclass
+class TableUpdateRequestBase(RESTRequest, ABC):
+    """Base class for all table update requests."""
+
+    _type: str = field(init=False, metadata=config(field_name="@type"))
+
+    @abstractmethod
+    def table_change(self) -> TableChange:
+        """Convert to table change operation"""
+        pass
+
+
+class TableUpdateRequest:
+    """Namespace for all table update request types."""
+
+    @dataclass_json
+    @dataclass
+    class RenameTableRequest(TableUpdateRequestBase):
+        """
+        Update request to rename a table
+        """
+
+        _new_name: str = field(metadata=config(field_name="newName"))
+        _new_schema_name: typing.Optional[str] = field(
+            default=None,
+            metadata=config(
+                field_name="newSchemaName",
+                exclude=lambda value: value is None,
+            ),
+        )
+
+        def __post_init__(self) -> None:

Review Comment:
   fix



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