Skip to content

Commit a7a54a8

Browse files
committed
rebased from main
1 parent 5cf98c9 commit a7a54a8

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

pyiceberg/catalog/sql.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@ def create_table(
174174
schema: Schema = self._convert_schema_if_needed(schema) # type: ignore
175175

176176
database_name, table_name = self.identifier_to_database_and_table(identifier)
177-
if not self._namespace_exists(database_name):
178-
self.create_namespace(database_name)
179-
180177
location = self._resolve_table_location(location, database_name, table_name)
181178
metadata_location = self._get_metadata_location(location=location)
182179
metadata = new_table_metadata(
@@ -539,10 +536,6 @@ def list_namespaces(self, namespace: Union[str, Identifier] = ()) -> List[Identi
539536
Raises:
540537
NoSuchNamespaceError: If a namespace with the given name does not exist.
541538
"""
542-
# Hierarchical namespace is not supported. Return an empty list
543-
if namespace:
544-
return []
545-
546539
if namespace and not self._namespace_exists(namespace):
547540
raise NoSuchNamespaceError(f"Namespace does not exist: {namespace}")
548541

tests/cli/test_console.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def test_rename_table_does_not_exists(catalog: Catalog) -> None:
386386
runner = CliRunner()
387387
result = runner.invoke(run, ["rename", "default.doesnotexist", "default.bar"])
388388
assert result.exit_code == 1
389-
assert result.output == "Namespace does not exist: default\n"
389+
assert result.output == "Table does not exist: ('default', 'doesnotexist')\n"
390390

391391

392392
def test_properties_get_table(catalog: Catalog) -> None:
@@ -797,7 +797,7 @@ def test_json_rename_table_does_not_exists(catalog: Catalog) -> None:
797797
runner = CliRunner()
798798
result = runner.invoke(run, ["--output=json", "rename", "default.doesnotexist", "default.bar"])
799799
assert result.exit_code == 1
800-
assert result.output == """{"type": "NoSuchNamespaceError", "message": "Namespace does not exist: default"}\n"""
800+
assert result.output == """{"type": "NoSuchTableError", "message": "Table does not exist: ('default', 'doesnotexist')"}\n"""
801801

802802

803803
def test_json_properties_get_table(catalog: Catalog) -> None:

0 commit comments

Comments
 (0)