我正在清理DBT + BigQuery环境,并试图实现从分期数据集中拉出的登台环境。问题是当前 .yml
带有源信息的文件都明确指向生产数据集。
我正在考虑的一个选项是 source
包装器函数,它将用作适配器并根据某些传递的CLI var
或配置文件注入适当的数据集(这对分阶段与产品环境)。
但是,我是DBT的新手,因此不确定这是否是最好的方法。您会很感激您善良的人都有的任何见解::)
编辑:我意识到 source
包装器不是要走的方法,因为它会弄乱生成的dag
I'm cleaning up a dbt + BigQuery environment and trying to implement a staging environment that pulls from a staging dataset. Problem is that the current .yml
files with source information all explicitly point to a production dataset.
One option that I am considering is a source
wrapper function that will serve as an adapter and inject the proper dataset depending on some passed CLI var
or profile target (which is different for the staging vs prod environments).
However, I'm fairly new to dbt so unsure if this is the best way to go about this. Would appreciate any insight you kind folks have :)
EDIT: I'm realizing that a source
wrapper is not the way to go as it would mess with the generated DAG
发布评论
评论(1)
您可以在a 环境变量,并在运行时设置该变量。
在您的
sources.yml
中:在您的
dbt_project.yml
中:然后在运行时覆盖:
You can supply the name of the schema for a source in a variable or environment variable, and set that variable at runtime.
In your
sources.yml
:In your
dbt_project.yml
:And then to override at runtime: