Skip to content

Commit 14742c3

Browse files
committed
Address comment
1 parent 4df5c36 commit 14742c3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pyiceberg/catalog/rest/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,14 @@ def namespace_exists(self, namespace: str | Identifier) -> bool:
11081108
namespace_tuple = self._check_valid_namespace_identifier(namespace)
11091109
namespace = self._encode_namespace_path(namespace_tuple)
11101110

1111+
# fallback in order to work with older rest catalog implementations
1112+
if Capability.V1_NAMESPACE_EXISTS not in self._supported_endpoints:
1113+
try:
1114+
self.load_namespace_properties(namespace_tuple)
1115+
return True
1116+
except NoSuchNamespaceError:
1117+
return False
1118+
11111119
response = self._session.head(self.url(Endpoints.namespace_exists, namespace=namespace))
11121120

11131121
if response.status_code == 404:

0 commit comments

Comments
 (0)