Skip to content

Commit

Permalink
Merge pull request #24 from lbk-fishtown/update-snapshots
Browse files Browse the repository at this point in the history
Update create_constraints_by_type to include Snapshots
  • Loading branch information
sfc-gh-dflippo authored Sep 13, 2022
2 parents 2d6eada + 39fb4af commit 7f59826
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions macros/create_constraints.sql
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@
{#- Find the table models that are referenced by this test.
These models must be physical tables and cannot be sources -#}
{%- set table_models = [] -%}
{%- for node in graph.nodes.values()
| selectattr("resource_type", "equalto", "model")
| selectattr("unique_id", "in", test_model.depends_on.nodes)
if node.config.materialized in( ("table", "incremental", "snapshot") ) -%}
{%- for node in graph.nodes.values() | selectattr("unique_id", "in", test_model.depends_on.nodes)
{#- Update to include snapshot resource type -#}
if node.resource_type in ( ( "model", "snapshot") )
if node.config.materialized in( ("table", "incremental", "snapshot") ) -%}

{#- Append to our list of models for this test -#}
{%- do table_models.append(node) -%}
{#- Append to our list of models &or snapshots for this test -#}
{%- do table_models.append(node) -%}

{% endfor %}

Expand Down

0 comments on commit 7f59826

Please sign in to comment.