Skip to content

Commit

Permalink
Fixing ovewrite integration tests (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
william-conti authored Apr 12, 2024
1 parent 8f3d164 commit 9a3517b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/integration/test_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ def test_deploys_database(ws, env_or_skip, make_random):
def test_overwrite(ws, env_or_skip, make_random):
schema = "default"
sql_backend = StatementExecutionBackend(ws, env_or_skip("TEST_DEFAULT_WAREHOUSE_ID"))
catalog = env_or_skip("TEST_CATALOG")
schema = env_or_skip("TEST_SCHEMA")

sql_backend.save_table(f"hive_metastore.{schema}.foo", [views.Foo("abc", True)], views.Foo, "append")
sql_backend.save_table(f"hive_metastore.{schema}.foo", [views.Foo("xyz", True)], views.Foo, "overwrite")
rows = list(sql_backend.fetch(f"SELECT * FROM hive_metastore.{schema}.some"))
sql_backend.save_table(f"{catalog}.{schema}.foo", [views.Foo("abc", True)], views.Foo, "append")
sql_backend.save_table(f"{catalog}.{schema}.foo", [views.Foo("xyz", True)], views.Foo, "overwrite")
rows = list(sql_backend.fetch(f"SELECT * FROM {catalog}.{schema}.foo"))

assert rows == [Row(name="xyz", id=1)]
assert rows == [Row(first="xyz", second=True)]

0 comments on commit 9a3517b

Please sign in to comment.