Skip to content

Commit

Permalink
add delta_table3_expected in test
Browse files Browse the repository at this point in the history
  • Loading branch information
milicevica23 committed Oct 13, 2023
1 parent cbca70d commit 0faf9bb
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tests/functional/plugins/test_delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
select * as a from {{ source('delta_source_test', 'table_2') }} WHERE y = 'd'
"""

delta3_sql_expected = """
select 1 as x, 'a' as y
"""


@pytest.mark.skip_profile("buenavista", "md")
class TestPlugins:
Expand All @@ -68,8 +72,8 @@ def delta_test_table2(self):
table_path = path / "test_delta_table2"

df = pd.DataFrame({
"x": [1, 2, 3, 2, 3, 4, 5, 6],
"y": ["a", "b", "b", "c", "d", "c", "d", "a"]
"x": [1],
"y": ["a"]
})
write_deltalake(table_path, df, mode="overwrite")

Expand Down Expand Up @@ -109,11 +113,19 @@ def models(self, delta_test_table1,delta_test_table2):
"delta_table1.sql": delta1_sql,
"delta_table2.sql": delta2_sql,
"delta_table3.sql": delta3_sql,
"delta_table3_expected.sql": delta3_sql_expected,
}

def test_plugins(self, project):
results = run_dbt()
assert len(results) == 3

assert len(results) == 4

# check_relations_equal(
# project.adapter,
# [
# "delta_table3",
# "delta_table3_expected",
# ],
# )
# res = project.run_sql("SELECT count(1) FROM 'delta_table3'", fetch="one")
# assert res[0] == 2

0 comments on commit 0faf9bb

Please sign in to comment.