Skip to content

Commit 2e38de7

Browse files
committed
removed assert table exists
1 parent a0984e0 commit 2e38de7

2 files changed

Lines changed: 0 additions & 22 deletions

File tree

integration_tests/tests/dbt_project.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -277,19 +277,3 @@ def write_yaml(self, content: dict, name: Optional[str] = None):
277277
YAML().dump(content, f)
278278
yield path
279279
path.unlink()
280-
281-
def assert_table_exists(self, table_name: str):
282-
table_exists_query = f"""
283-
select 1
284-
from information_schema.tables
285-
where table_name = '{table_name}'
286-
"""
287-
try:
288-
table_exists_result = self.run_query(table_exists_query)
289-
except IndexError:
290-
table_exists_result = []
291-
except Exception as e:
292-
raise AssertionError(f"Failed to check if {table_name} exists: {e}")
293-
assert (
294-
table_exists_result
295-
), f"{table_name} table does not exist. The artifact was not created."

integration_tests/tests/test_dbt_artifacts/test_groups.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ def test_model_and_groups(dbt_project: DbtProject, tmp_path):
138138
dbt_project.dbt_runner.vars["disable_dbt_artifacts_autoupload"] = False
139139
dbt_project.dbt_runner.vars["disable_run_results"] = False
140140
dbt_project.dbt_runner.run(select=model_name)
141-
dbt_project.assert_table_exists("dbt_models")
142141

143142
models = dbt_project.read_table(
144143
"dbt_models", where=f"name = '{model_name}'", raise_if_empty=True
@@ -228,7 +227,6 @@ def test_two_groups(dbt_project: DbtProject, tmp_path):
228227
dbt_project.dbt_runner.vars["disable_dbt_artifacts_autoupload"] = False
229228
dbt_project.dbt_runner.vars["disable_run_results"] = False
230229
dbt_project.dbt_runner.run(select=f"{model_name_1} {model_name_2}")
231-
dbt_project.assert_table_exists("dbt_models")
232230

233231
# Check both models and their groups/owners
234232
assert_group_row_in_db_groups(
@@ -297,7 +295,6 @@ def test_test_group_attribute(dbt_project: DbtProject, tmp_path):
297295
try:
298296
dbt_project.dbt_runner.vars["disable_dbt_artifacts_autoupload"] = False
299297
dbt_project.dbt_runner.run(select=model_name)
300-
dbt_project.assert_table_exists("dbt_tests")
301298
tests = dbt_project.read_table(
302299
"dbt_tests", where="name LIKE 'unique%'", raise_if_empty=True
303300
)
@@ -362,7 +359,6 @@ def test_test_override_group(dbt_project: DbtProject, tmp_path):
362359
try:
363360
dbt_project.dbt_runner.vars["disable_dbt_artifacts_autoupload"] = False
364361
dbt_project.dbt_runner.run(select=model_name)
365-
dbt_project.assert_table_exists("dbt_tests")
366362
tests = dbt_project.read_table(
367363
"dbt_tests", where="name LIKE 'unique%'", raise_if_empty=True
368364
)
@@ -430,7 +426,6 @@ def test_seed_group_attribute(dbt_project: DbtProject, tmp_path):
430426
dbt_project.dbt_runner.vars["disable_dbt_artifacts_autoupload"] = False
431427
dbt_project.dbt_runner.vars["disable_run_results"] = False
432428
dbt_project.dbt_runner.seed(select=seed_name)
433-
dbt_project.assert_table_exists("dbt_seeds")
434429
seeds = dbt_project.read_table(
435430
"dbt_seeds", where=f"name = '{seed_name}'", raise_if_empty=True
436431
)
@@ -507,7 +502,6 @@ def test_snapshot_group_attribute(dbt_project: DbtProject, tmp_path):
507502
dbt_project.dbt_runner.vars["disable_dbt_artifacts_autoupload"] = False
508503
dbt_project.dbt_runner.vars["disable_run_results"] = False
509504
dbt_project.dbt_runner.snapshot()
510-
dbt_project.assert_table_exists("dbt_snapshots")
511505

512506
snapshots = dbt_project.read_table(
513507
"dbt_snapshots", where=f"name = '{snapshot_name}'", raise_if_empty=False

0 commit comments

Comments
 (0)