You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by gi...@apache.org on 2026/09/13 17:40:03 UTC
(iceberg-python) 01/01: REST: Add missing endpoint check for creating views (#3442)
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-3442-5133f353722c83b3145f7724e1bed05f8938f214
in repository https://gitbox.apache.org/repos/asf/iceberg-python.git
commit efb721417397905163d1d09991fbd7841f16dcb0
Author: Yuya Ebihara <eb...@gmail.com>
AuthorDate: Sun Sep 13 17:39:38 2026 +0000
REST: Add missing endpoint check for creating views (#3442)
---
pyiceberg/catalog/rest/__init__.py | 3 +++
tests/catalog/test_rest.py | 1 +
2 files changed, 4 insertions(+)
diff --git a/pyiceberg/catalog/rest/__init__.py b/pyiceberg/catalog/rest/__init__.py
index e7131b1a8..b6c7720b0 100644
--- a/pyiceberg/catalog/rest/__init__.py
+++ b/pyiceberg/catalog/rest/__init__.py
@@ -206,6 +206,7 @@ class Capability:
V1_LIST_VIEWS = Endpoint(http_method=HttpMethod.GET, path=f"{API_PREFIX}/{Endpoints.list_views}")
V1_LOAD_VIEW = Endpoint(http_method=HttpMethod.GET, path=f"{API_PREFIX}/{Endpoints.load_view}")
V1_VIEW_EXISTS = Endpoint(http_method=HttpMethod.HEAD, path=f"{API_PREFIX}/{Endpoints.view_exists}")
+ V1_CREATE_VIEW = Endpoint(http_method=HttpMethod.POST, path=f"{API_PREFIX}/{Endpoints.create_view}")
V1_REGISTER_VIEW = Endpoint(http_method=HttpMethod.POST, path=f"{API_PREFIX}/{Endpoints.register_view}")
V1_DELETE_VIEW = Endpoint(http_method=HttpMethod.DELETE, path=f"{API_PREFIX}/{Endpoints.drop_view}")
V1_SUBMIT_TABLE_SCAN_PLAN = Endpoint(http_method=HttpMethod.POST, path=f"{API_PREFIX}/{Endpoints.plan_table_scan}")
@@ -243,6 +244,7 @@ VIEW_ENDPOINTS: frozenset[Endpoint] = frozenset(
(
Capability.V1_LIST_VIEWS,
Capability.V1_LOAD_VIEW,
+ Capability.V1_CREATE_VIEW,
Capability.V1_DELETE_VIEW,
)
)
@@ -1280,6 +1282,7 @@ class RestCatalog(Catalog):
location: str | None = None,
properties: Properties = EMPTY_DICT,
) -> View:
+ self._check_endpoint(Capability.V1_CREATE_VIEW)
iceberg_schema = self._convert_schema_if_needed(schema)
fresh_schema = assign_fresh_schema_ids(iceberg_schema)
diff --git a/tests/catalog/test_rest.py b/tests/catalog/test_rest.py
index 0953c5f79..1b6315aa5 100644
--- a/tests/catalog/test_rest.py
+++ b/tests/catalog/test_rest.py
@@ -115,6 +115,7 @@ TEST_SUPPORTED_ENDPOINTS = [
Capability.V1_LIST_VIEWS,
Capability.V1_LOAD_VIEW,
Capability.V1_VIEW_EXISTS,
+ Capability.V1_CREATE_VIEW,
Capability.V1_REGISTER_VIEW,
Capability.V1_DELETE_VIEW,
Capability.V1_SUBMIT_TABLE_SCAN_PLAN,