Abyss-lord commented on code in PR #9870: URL: https://github.com/apache/gravitino/pull/9870#discussion_r2903743956
########## clients/client-python/gravitino/dto/requests/table_update_request.py: ########## @@ -0,0 +1,833 @@ +# 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 typing +from abc import 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._helper.serdes_utils import SerdesUtils +from gravitino.api.rel.types.type import Type +from gravitino.rest.rest_message import RESTRequest + + +@dataclass_json +@dataclass +class TableUpdateRequestBase(RESTRequest): + """Base class for all table update requests.""" + + _type: str = field(metadata=config(field_name="@type")) + + def __init__(self, action_type: str) -> None: + self._type = action_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")) 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]
