Skip to content

Commit

Permalink
Expect merge to be a valid strategy for Postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
dbeatty10 committed Jun 23, 2023
1 parent bd48ea2 commit 4dd46ec
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/functional/materializations/test_incremental.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ def test_basic(project):
assert macro_func
assert type(macro_func).__name__ == "MacroGenerator"

# These two incremental strategies are not valid for Postgres
with pytest.raises(DbtRuntimeError) as excinfo:
macro_func = project.adapter.get_incremental_strategy_macro(context, "merge")
assert "merge" in str(excinfo.value)
# This incremental strategy only works for Postgres >= 15
macro_func = project.adapter.get_incremental_strategy_macro(context, "merge")
assert macro_func
assert type(macro_func).__name__ == "MacroGenerator"

# This incremental strategy is not valid for Postgres
with pytest.raises(DbtRuntimeError) as excinfo:
macro_func = project.adapter.get_incremental_strategy_macro(context, "insert_overwrite")
assert "insert_overwrite" in str(excinfo.value)

0 comments on commit 4dd46ec

Please sign in to comment.