File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,19 +70,23 @@ def test_reads_s3_tables_catalog(self):
7070 connect (schema_name = schema , catalog_name = ENV .s3tables_catalog ) as conn ,
7171 conn .cursor () as cursor ,
7272 ):
73- cursor .execute (
74- f"CREATE TABLE { schema } .{ table } (a INT, b STRING) "
75- "PARTITIONED BY (b) TBLPROPERTIES ('table_type'='ICEBERG')"
76- )
7773 try :
74+ # Inside try: a CREATE that fails after Athena made the table
75+ # still gets it dropped.
76+ cursor .execute (
77+ f"CREATE TABLE { schema } .{ table } (a INT, b STRING) "
78+ "PARTITIONED BY (b) TBLPROPERTIES ('table_type'='ICEBERG')"
79+ )
7880 glue = conn ._glue
7981 # Glue addresses a table-bucket catalog by its Athena name.
8082 assert self ._view (
8183 glue .get_table (ENV .s3tables_catalog , schema , table )
8284 ) == self ._view (cursor .get_table_metadata (table ))
83- assert [
84- self ._view (m ) for m in glue .list_tables (ENV .s3tables_catalog , schema , table )
85- ] == [self ._view (m ) for m in cursor .list_table_metadata (expression = table )]
85+ listed = glue .list_tables (ENV .s3tables_catalog , schema , table )
86+ assert [m .name for m in listed ] == [table ]
87+ assert [self ._view (m ) for m in listed ] == [
88+ self ._view (m ) for m in cursor .list_table_metadata (expression = table )
89+ ]
8690 assert schema in [d .name for d in glue .list_databases (ENV .s3tables_catalog )]
8791 finally :
8892 cursor .execute (f"DROP TABLE IF EXISTS { schema } .{ table } " )
You can’t perform that action at this time.
0 commit comments