Skip to content

Commit

Permalink
Update _is_ephemeral while we're here
Browse files Browse the repository at this point in the history
  • Loading branch information
jtcohen6 committed Aug 20, 2020
1 parent 25eba99 commit 9acf4b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions macros/cross_db_utils/_is_ephemeral.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% macro _is_ephemeral(obj, macro) %}
{%- if obj.is_cte -%}
{% if obj.name.startswith('__dbt__CTE__') %}
{% set model_name = obj.name[12:] %}
{% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}
{% if obj.name.startswith(ephemeral_prefix) %}
{% set model_name = obj.name[(ephemeral_prefix|length):] %}
{% else %}
{% set model_name = obj.name %}
{%- endif -%}
Expand Down

0 comments on commit 9acf4b2

Please sign in to comment.