Skip to content

Commit 9d7676d

Browse files
authored
Merge pull request #371 from dbt-labs/fix-exclusion
add excluded package
2 parents 88e916f + b3b3a04 commit 9d7676d

File tree

9 files changed

+47
-2
lines changed

9 files changed

+47
-2
lines changed

integration_tests/dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ seeds:
5959

6060
vars:
6161
# ensure integration tests run successfully when there are 0 of a given model type (extra)
62-
exclude_packages: []
62+
exclude_packages: ['exclude_package']
6363
exclude_paths_from_project: ["/to_exclude/","source_3.table_6"]
6464
model_types: ['staging', 'intermediate', 'marts', 'other', 'extra', 'new_model_type']
6565
# dummy variable used for testing fct_hard_coded_references
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
# Name your project! Project names should contain only lowercase characters
3+
# and underscores. A good package name should reflect your organization's
4+
# name or the intended use of these models
5+
name: 'exclude_package'
6+
version: '1.0.0'
7+
config-version: 2
8+
9+
# This setting configures which "profile" dbt uses for this project.
10+
profile: 'integration_tests'
11+
12+
# These configurations specify where dbt should look for different types of files.
13+
# The `source-paths` config, for example, states that models in this project can be
14+
# found in the "models/" directory. You probably won't need to change these!
15+
model-paths: ["models"]
16+
analysis-paths: ["analysis"]
17+
test-paths: ["tests"]
18+
seed-paths: ["seeds"]
19+
macro-paths: ["macros"]
20+
snapshot-paths: ["snapshots"]
21+
22+
target-path: "target" # directory which will store compiled SQL files
23+
clean-targets: # directories to be removed by `dbt clean`
24+
- "target"
25+
- "dbt_packages"
26+
27+
models:
28+
exclude_package:
29+
# materialize as ephemeral to prevent the fake models from executing, but keep them enabled
30+
+materialized: view
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
models:
2+
- name: excluded_model
3+
access: public
4+
config:
5+
contract:
6+
enforced: true
7+
columns:
8+
- name: id
9+
data_type: integer
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
select 1 as id

integration_tests/packages.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
packages:
2-
- local: ../
2+
- local: ../
3+
- local: exclude_package/

models/marts/governance/fct_exposures_dependent_on_private_models.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ direct_exposure_relationships as (
99
parent_resource_type = 'model'
1010
and parent_is_public
1111
)
12+
and not parent_is_excluded
1213
),
1314

1415
final as (

models/marts/governance/fct_public_models_without_contract.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ with
22

33
all_resources as (
44
select * from {{ ref('int_all_graph_resources') }}
5+
where not is_excluded
56
),
67

78
final as (

models/marts/governance/fct_undocumented_public_models.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ with
22

33
all_resources as (
44
select * from {{ ref('int_all_graph_resources') }}
5+
where not is_excluded
56
),
67

78
final as (

models/marts/structure/fct_model_directories.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
with all_graph_resources as (
77
select * from {{ ref('int_all_graph_resources') }}
8+
where not is_excluded
89
),
910

1011
folders as (

0 commit comments

Comments
 (0)