We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4df5c36 commit 14742c3Copy full SHA for 14742c3
pyiceberg/catalog/rest/__init__.py
@@ -1108,6 +1108,14 @@ def namespace_exists(self, namespace: str | Identifier) -> bool:
1108
namespace_tuple = self._check_valid_namespace_identifier(namespace)
1109
namespace = self._encode_namespace_path(namespace_tuple)
1110
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
+
1119
response = self._session.head(self.url(Endpoints.namespace_exists, namespace=namespace))
1120
1121
if response.status_code == 404:
0 commit comments