[CT-1829] [Bug] [v1.4.0rc1] Back compat in get_merge_sql
macro signature
#6625
Labels
Milestone
get_merge_sql
macro signature
#6625
Prompted by Slack thread
Context
In #5702, we changed the signature of the
get_merge_sql()
macro. This could have implications for users who callget_merge_sql()
directly from a custom macro/materialization.In
main
/1.4.latest
:dbt-core/core/dbt/include/global_project/macros/materializations/models/incremental/merge.sql
Lines 1 to 5 in 065ab2e
In
1.3.latest
:dbt-core/core/dbt/include/global_project/macros/materializations/models/incremental/merge.sql
Lines 1 to 5 in 3f17044
Repro case
This means that if someone has custom code like the following, they'll start seeing a compilation error in v1.4. (Yes, these are very silly examples! No one should ever call this macro like this.)
Resolution
I think we can provide backwards compatibility quite simply by:
incremental_predicates
back to optional, by providing a default value ofNone
predicates
is passed as a kwarg, and passing it intoincremental_predicates
if soWith that change, both of the silly code examples above start working again.
(If someone passes both
predicates
andincremental_predicates
as keyword arguments, that's on them.)The text was updated successfully, but these errors were encountered: