Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fill owner in dbt docs UI?

Tags:

dbt

I want to set the owner for dbt models from yml file. I have tried everything.

enter image description here

---
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

like image 519
Silent Avatar asked Sep 08 '25 16:09

Silent


2 Answers

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

1. define a group in a YAML file

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

2. assign that group to your models

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:

a) Project-level configuration in dbt_project.yml:

#dbt_project.yml
models:
  marts:
    finance:
      +group: finance

b) Model-level configuration in a model's specific YAML file:

# models/marts/finance/finance_model.yml
version: 2

models:
  - name: finance_model
    config:
      group: finance

c) In-file configuration within the same YAML file as the group declaration:

# models/marts/finance/finance.yml
version: 2

models:
  - name: finance_model
    config:
      group: finance

groups:
  - name: finance
    owner:
      email: [email protected]
like image 174
Alex Avatar answered Sep 10 '25 05:09

Alex


Finally I can do it

A. Add schema file

make this file src/models/some_version/some_squad/some_domain/schema.yml

B. Content

version: 2

models:
  - name: some_model_name
    meta:
       owner: 'some_owner'
       domain: 
        - some_domain_
        - some_domain_2
    description: |
      some description

C. Final result

enter image description here

like image 28
ejabu Avatar answered Sep 10 '25 06:09

ejabu