Skip to content

Commit

Permalink
change existig test to verify that dropping unknown tables fails sile…
Browse files Browse the repository at this point in the history
…ntly
  • Loading branch information
sh-rp committed Oct 13, 2024
1 parent d4f4bf5 commit 7c8e5b8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/load/test_job_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,16 +373,14 @@ def test_drop_tables(client: SqlJobClientBase) -> None:
client.drop_tables(tables_to_drop[0], "not_exists", *tables_to_drop[1:])
client._update_schema_in_storage(schema) # Schema was deleted, load it in again
if isinstance(client, WithStagingDataset):
with contextlib.suppress(DatabaseUndefinedRelation):
with client.with_staging_dataset():
client.drop_tables(*tables_to_drop, delete_schema=False)
with client.with_staging_dataset():
client.drop_tables(*tables_to_drop, delete_schema=False)
# drop again - should not break anything
client.drop_tables(*tables_to_drop)
client._update_schema_in_storage(schema)
if isinstance(client, WithStagingDataset):
with contextlib.suppress(DatabaseUndefinedRelation):
with client.with_staging_dataset():
client.drop_tables(*tables_to_drop, delete_schema=False)
with client.with_staging_dataset():
client.drop_tables(*tables_to_drop, delete_schema=False)

# Verify requested tables are dropped
assert all(len(table[1]) == 0 for table in client.get_storage_tables(tables_to_drop))
Expand Down

0 comments on commit 7c8e5b8

Please sign in to comment.