rdblue commented on code in PR #5287:
URL: https://github.com/apache/iceberg/pull/5287#discussion_r931508946


##########
python/pyiceberg/catalog/rest.py:
##########
@@ -0,0 +1,435 @@
+#  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 json import JSONDecodeError
+from typing import (
+    Dict,
+    List,
+    Optional,
+    Set,
+    Tuple,
+    Type,
+    Union,
+)
+
+import requests
+from pydantic import Field
+from requests import HTTPError
+
+from pyiceberg import __version__
+from pyiceberg.catalog import Identifier, Properties
+from pyiceberg.catalog.base import Catalog, PropertiesUpdateSummary
+from pyiceberg.exceptions import (
+    AlreadyExistsError,
+    AuthorizationExpiredError,
+    BadCredentialsError,
+    BadRequestError,
+    ForbiddenError,
+    NoSuchNamespaceError,
+    RESTError,
+    ServerError,
+    ServiceUnavailableError,
+    TableAlreadyExistsError,
+    UnauthorizedError,
+)
+from pyiceberg.schema import Schema
+from pyiceberg.table.base import Table
+from pyiceberg.table.metadata import TableMetadataV1, TableMetadataV2
+from pyiceberg.table.partitioning import UNPARTITIONED_PARTITION_SPEC, 
PartitionSpec
+from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
+from pyiceberg.utils.iceberg_base_model import IcebergBaseModel
+
+
+class Endpoints:
+    get_config: str = "config"
+    list_namespaces: str = "namespaces"
+    create_namespace: str = "namespaces"
+    load_namespace_metadata: str = "namespaces/{namespace}"
+    drop_namespace: str = "namespaces/{namespace}"
+    update_properties: str = "namespaces/{namespace}/properties"
+    list_tables: str = "namespaces/{namespace}/tables"
+    create_table: str = "namespaces/{namespace}/tables"
+    load_table: str = "namespaces/{namespace}/tables/{table}"
+    update_table: str = "namespaces/{namespace}/tables/{table}"
+    drop_table: str = 
"namespaces/{namespace}/tables/{table}?purgeRequested={purge}"
+    table_exists: str = "namespaces/{namespace}/tables/{table}"
+    get_token: str = "oauth/tokens"
+    rename_table: str = "tables/rename"
+
+
+AUTHORIZATION_HEADER = "Authorization"
+BEARER_PREFIX = "Bearer"
+CATALOG_SCOPE = "catalog"
+CLIENT_ID = "client_id"
+PREFIX = "prefix"
+CLIENT_SECRET = "client_secret"
+CLIENT_CREDENTIALS = "client_credentials"
+CREDENTIAL = "credential"
+GRANT_TYPE = "grant_type"
+SCOPE = "scope"
+TOKEN_EXCHANGE = "urn:ietf:params:oauth:grant-type:token-exchange"
+
+NAMESPACE_SEPARATOR = b"\x1F".decode("UTF-8")
+
+
+class TableResponse(IcebergBaseModel):
+    metadata_location: Optional[str] = Field(alias="metadata-location", 
default=None)

Review Comment:
   I see that this is optional in the spec, but I think we want to make it 
required in the spec. Otherwise, you wouldn't be able to tell when the metadata 
changes. The `refresh` call will call the load route again and update the 
metadata if it has changed.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to