Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyiceberg/catalog/hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ def update_namespace_properties(
if removals:
for key in removals:
if key in parameters:
parameters[key] = None
parameters.pop(key)
removed.add(key)
if updates:
for key, value in updates.items():
Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/catalog/rest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ def _create_table(
try:
response.raise_for_status()
except HTTPError as exc:
_handle_non_200_response(exc, {409: TableAlreadyExistsError})
_handle_non_200_response(exc, {409: TableAlreadyExistsError, 404: NoSuchNamespaceError})
return TableResponse.model_validate_json(response.text)

@retry(**_RETRY_ARGS)
Expand Down
2 changes: 1 addition & 1 deletion tests/catalog/test_hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ def test_update_namespace_properties(hive_database: HiveDatabase) -> None:
name="default",
description=None,
locationUri=hive_database.locationUri,
parameters={"test": None, "label": "core"},
parameters={"label": "core"},
privileges=None,
ownerName=None,
ownerType=1,
Expand Down
10 changes: 8 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2318,13 +2318,19 @@ def fixture_s3_client() -> boto3.client:
yield boto3.client("s3")


def clean_up(test_catalog: Catalog) -> None:
def clean_up(test_catalog: Catalog, drop_if_cannot_purge: bool = False) -> None:
"""Clean all databases and tables created during the integration test."""
for database_tuple in test_catalog.list_namespaces():
database_name = database_tuple[0]
if "my_iceberg_database-" in database_name:
for identifier in test_catalog.list_tables(database_name):
test_catalog.purge_table(identifier)
try:
test_catalog.purge_table(identifier)
except Exception as e:
if drop_if_cannot_purge:
test_catalog.drop_table(identifier)
else:
raise e
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just default to drop_table here? and worry about purge_table later. its not yet implemented in pyiceberg's hive client

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I will modify to drop here instead of purge -- should be fine as integration tests are transient? I dont think we will end up writing dangling data right?

test_catalog.drop_namespace(database_name)


Expand Down
Loading
Loading