I want to set the owner for dbt models from yml file. I have tried everything.
---
version: 2
models:
- name: my_model
description: "Foo bar"
owner: 'XXXX' # not work
config:
owner: 'XXXX' # not work
meta:
owner: 'XXXX' # not work
dbt-core 1.2.2
I also stumbled across this problem and found the following:
The meta property is a flexible field that allows you to add custom metadata to your models. As the answer from ejabu correctly describes the custom owner field on top can be set as he described.
However, if you're looking to use the owner field like you requested in your screenshot, you should the following:
dbt_owner
Here's how you can declare a group (source dbt docs):
# models/marts/finance/finance.yml
groups:
- name: finance
owner:
email: [email protected]
slack: finance-data
github: finance-data-team
After declaring the group, you can add models to this group by using the group configuration key at the project level, model level, or within the same file:
#dbt_project.yml
models:
marts:
finance:
+group: finance
# models/marts/finance/finance_model.yml
version: 2
models:
- name: finance_model
config:
group: finance
# models/marts/finance/finance.yml
version: 2
models:
- name: finance_model
config:
group: finance
groups:
- name: finance
owner:
email: [email protected]
Finally I can do it
make this file
src/models/some_version/some_squad/some_domain/schema.yml
version: 2
models:
- name: some_model_name
meta:
owner: 'some_owner'
domain:
- some_domain_
- some_domain_2
description: |
some description
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With