Skip to content

Commit

Permalink
Add CTE prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
psousa50 committed Nov 22, 2023
1 parent 81e5e9a commit 49f92aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion integration-tests/tests/unit/model_b_references_a.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
UNION ALL

{% call test_condition_on_model_query('model_b_references_a', "should quote CTE", {},
assert_should_contain, dbt_unit_testing.quote_identifier("model_a")) %}
assert_should_contain, dbt_unit_testing.quote_identifier("DBT_CTE__model_a")) %}
{% call dbt_unit_testing.mock_ref ('model_a') %}
select 1 as id
{% endcall %}
Expand Down
2 changes: 1 addition & 1 deletion macros/sql_builders.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

{% macro ref_cte_name(node) %}
{% set node = dbt_unit_testing.model_node(node) %}
{% set parts = [node.name] %}
{% set parts = ["DBT_CTE", node.name] %}
{% if node.package_name != model.package_name %}
{% set parts = [node.package_name] + parts %}
{% endif %}
Expand Down

0 comments on commit 49f92aa

Please sign in to comment.