|
1 |
| -{%- macro deduplicate(relation, partition_by, order_by=none, relation_alias=none) -%} |
2 |
| - |
3 |
| - {%- set error_message_group_by -%} |
4 |
| -Warning: the `group_by` parameter of the `deduplicate` macro is no longer supported and will be deprecated in a future release of dbt-utils. |
5 |
| -Use `partition_by` instead. |
6 |
| -The {{ model.package_name }}.{{ model.name }} model triggered this warning. |
7 |
| - {%- endset -%} |
8 |
| - |
9 |
| - {% if kwargs.get('group_by') %} |
10 |
| - {%- do exceptions.warn(error_message_group_by) -%} |
11 |
| - {%- endif -%} |
12 |
| - |
13 |
| - {%- set error_message_order_by -%} |
14 |
| -Warning: `order_by` as an optional parameter of the `deduplicate` macro is no longer supported and will be deprecated in a future release of dbt-utils. |
15 |
| -Supply a non-null value for `order_by` instead. |
16 |
| -The {{ model.package_name }}.{{ model.name }} model triggered this warning. |
17 |
| - {%- endset -%} |
18 |
| - |
19 |
| - {% if not order_by %} |
20 |
| - {%- do exceptions.warn(error_message_order_by) -%} |
21 |
| - {%- endif -%} |
22 |
| - |
23 |
| - {%- set error_message_alias -%} |
24 |
| -Warning: the `relation_alias` parameter of the `deduplicate` macro is no longer supported and will be deprecated in a future release of dbt-utils. |
25 |
| -If you were using `relation_alias` to point to a CTE previously then you can now pass the alias directly to `relation` instead. |
26 |
| -The {{ model.package_name }}.{{ model.name }} model triggered this warning. |
27 |
| - {%- endset -%} |
28 |
| - |
29 |
| - {% if relation_alias %} |
30 |
| - {%- do exceptions.warn(error_message_alias) -%} |
31 |
| - {%- endif -%} |
32 |
| - |
33 |
| - {% set partition_by = partition_by or kwargs.get('group_by') %} |
34 |
| - {% set relation = relation_alias or relation %} |
35 |
| - {% set order_by = order_by or "'1'" %} |
36 |
| - |
| 1 | +{%- macro deduplicate(relation, partition_by, order_by) -%} |
37 | 2 | {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}
|
38 | 3 | {% endmacro %}
|
39 | 4 |
|
|
0 commit comments