Skip to content

Commit 3d29555

Browse files
committed
Add namespace check
1 parent 4348ee8 commit 3d29555

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pyiceberg/catalog/rest/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,11 @@ def rename_table(self, from_identifier: Union[str, Identifier], to_identifier: U
654654
"source": self._split_identifier_for_json(from_identifier),
655655
"destination": self._split_identifier_for_json(to_identifier),
656656
}
657+
658+
# Ensure that namespaces exist on source and destination.
659+
self.namespace_exists(self._split_identifier_for_json(from_identifier)["namespace"])
660+
self.namespace_exists(self._split_identifier_for_json(to_identifier)["namespace"])
661+
657662
response = self._session.post(self.url(Endpoints.rename_table), json=payload)
658663
try:
659664
response.raise_for_status()

0 commit comments

Comments
 (0)