isc-patrick commented on code in PR #1155:
URL: https://github.com/apache/iceberg-python/pull/1155#discussion_r1763403718
##########
tests/catalog/test_sql.py:
##########
@@ -225,6 +237,93 @@ def test_creation_from_impl(catalog_name: str, warehouse:
Path) -> None:
)
+def confirm_no_tables_exist(alchemy_engine: Engine) -> list[str]:
+ inspector = inspect(alchemy_engine)
+ for c in SqlCatalogBaseTable.__subclasses__():
+ if inspector.has_table(c.__tablename__):
+ c.__table__.drop(alchemy_engine)
+
+ catalog_tables = [c.__tablename__ for c in
SqlCatalogBaseTable.__subclasses__()]
+ any_table_exists = any(t for t in inspector.get_table_names() if t in
catalog_tables)
+ if any_table_exists:
+ pytest.raises(TableAlreadyExistsError, "Tables exist, but should not
have been created yet")
+
+ return catalog_tables
+
+
+def confirm_all_tables_exist(inspector: Inspector, catalog_tables: list[str],
catalog: Catalog) -> None:
Review Comment:
Not passing the inspector anymore. Also needed to cast the Catalog to use
the engine. Made the uri a fixture to insure using same source between catalog
and inspector that was creating tables.
--
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]