-
Notifications
You must be signed in to change notification settings - Fork 238
Open
Labels
ImprovementImproves existing functionalityImproves existing functionality
Description
If we have a project where majority of our models need to use blueprints then it can get repetitive adding the blueprint config to each model. One example of this is let's say you have to build models in different data regions. You could have region as a blueprint variable and that could be utilized in the gateway parameter as well of a model config.
If a model doesn't need to utilize the model default then we could disable it by doing overriding it like this:
blueprints (
@region: false
)
Example of model:
MODEL (
name '@region.schema.table_name',
blueprints (
(region := us),
(region := eu)
),
gateway @regional_gateway(@region),
name @model_name(@region, 'core_data', 'fct_events'),
kind INCREMENTAL_BY_TIME_RANGE (,
time_column event_timestamp,
lookback 4
)
SELECT
column1,
column2,
event_timestamp
FROM `@{region}.events`
WHERE
event_timestamp BETWEEN @start_dt AND @end_dt
Example of model defaults:
model_defaults:
dialect: snowflake
start: 2022-01-01
blueprints:
@region: ['us', 'eu']
benhinchley
Metadata
Metadata
Assignees
Labels
ImprovementImproves existing functionalityImproves existing functionality