HonahX commented on code in PR #711:
URL: https://github.com/apache/iceberg-python/pull/711#discussion_r1608625978
##########
tests/catalog/test_glue.py:
##########
@@ -848,3 +848,17 @@ def test_table_exists(
assert test_catalog.table_exists(identifier) is True
# Act and Assert for a non-existing table
assert test_catalog.table_exists(('non', 'exist')) is False
+
+
+@mock_aws
+def test_register_table_with_given_location(
+ _bucket_initialize: None, moto_endpoint_url: str, metadata_location: str,
database_name: str, table_name: str
+) -> None:
+ catalog_name = "glue"
+ identifier = (database_name, table_name)
+ location = metadata_location
+ test_catalog = GlueCatalog(catalog_name, **{"s3.endpoint":
moto_endpoint_url, "warehouse": f"s3://{BUCKET_NAME}"})
+ test_catalog.create_namespace(namespace=database_name,
properties={"location": f"s3://{BUCKET_NAME}/{database_name}.db"})
+ table = test_catalog.register_table(identifier, location)
+ assert table.identifier == (catalog_name,) + identifier
+ assert test_catalog.table_exists(identifier) is True
Review Comment:
I also got the same error when running the integration test. It is because
the integration test tries to purge the tables after the test as a last step:
https://github.com/apache/iceberg-python/blob/62b527e74cff328fde5faa848519c56748a244c1/tests/conftest.py#L1919-L1926
Since `test_register_table` use a mocked metadata file, the manifest files
recorded in the metadata file does not exist. Hence, we encounter error here
since the `clean_up` try to delete a manifest file that never existed.
(The `integration_test_glue.py` is not run by git actions since it requires
a real AWS account and a bucket.)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]