kevinjqliu commented on code in PR #711:
URL: https://github.com/apache/iceberg-python/pull/711#discussion_r1600447450
##########
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've seen that issue come up several times in the glue context.
Here are some related issues that might provide some hints
https://github.com/apache/iceberg-python/issues/570
https://github.com/apache/iceberg-python/issues/515
https://github.com/apache/iceberg-python/issues/692
--
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]