@@ -232,6 +232,8 @@ def __init__(self, name: str, **properties: str):
232232 self ._fetch_config ()
233233 self ._session = self ._create_session ()
234234 separator_from_properties = self .properties .get (NAMESPACE_SEPARATOR_PROPERTY , DEFAULT_NAMESPACE_SEPARATOR )
235+ if not separator_from_properties :
236+ raise ValueError ("Namespace separator cannot be an empty string" )
235237 self ._namespace_separator = unquote (separator_from_properties )
236238
237239 def _create_session (self ) -> Session :
@@ -396,8 +398,6 @@ def _identifier_to_validated_tuple(self, identifier: str | Identifier) -> Identi
396398 def _split_identifier_for_path (
397399 self , identifier : str | Identifier | TableIdentifier , kind : IdentifierKind = IdentifierKind .TABLE
398400 ) -> Properties :
399- from urllib .parse import quote
400-
401401 if isinstance (identifier , TableIdentifier ):
402402 return {
403403 "namespace" : self ._encode_namespace_path (tuple (identifier .namespace .root )),
@@ -783,7 +783,7 @@ def list_namespaces(self, namespace: str | Identifier = ()) -> list[Identifier]:
783783 namespace_tuple = self .identifier_to_tuple (namespace )
784784 response = self ._session .get (
785785 self .url (
786- f"{ Endpoints .list_namespaces } ?parent={ self ._namespace_separator . join (namespace_tuple )} "
786+ f"{ Endpoints .list_namespaces } ?parent={ self ._encode_namespace_path (namespace_tuple )} "
787787 if namespace_tuple
788788 else Endpoints .list_namespaces
789789 ),
0 commit comments