logic to remove unwanted models

This commit is contained in:
Dave Connors
2023-02-21 08:52:49 -06:00
parent 9cdf945973
commit eb7addf598
2 changed files with 9 additions and 1 deletions

View File

@@ -61,6 +61,7 @@ vars:
# -- DAG variables --
models_fanout_threshold: 3
include_package_models: true
# -- Naming conventions variables --
# to add a new "model type", update the variable model_types

View File

@@ -41,7 +41,14 @@ unioned_with_calc as (
{{ get_dbtreplace_directory_pattern() }} as directory_path,
regexp_replace(file_path,'.*{{ get_regexp_directory_pattern() }}','') as file_name
from unioned
where coalesce(is_enabled, True) = True and package_name != 'dbt_project_evaluator'
where
coalesce(is_enabled, True) = True
{% if not var('include_package_models') %}
and package_name = '{{ project_name }}'
{% else %}
and package_name != 'dbt_project_evaluator'
{% endif %}
),
joined as (