Is it possible to add an owner to a singular test ...
# ask-elementary-ai
j
Is it possible to add an owner to a singular test in DBT so that it is sorted correctly in the Elementary dashboard? All of my singular tests currently get filed under "No owners". I suppose this is more of a DBT question than an Elementary one, but it affects our ability to organize our Elementary dashboard.
k
A message from kapa.ai
Yes, you can add an owner to a singular test in dbt, but there are some specific considerations for how Elementary handles this. For singular tests (custom SQL tests in the tests folder), you can add an owner using the config block at the top of your test SQL file:
Copy code
sql {{ config(     meta={         "owner": "@username",         "description": "This is a description"     } ) }}  <test query here>
However, there are a few important things to note: 1. Elementary currently has better support for model owners than test owners. The owner property is primarily attached to models, not tests [Link to forum discussion](https://slack.com/archives/C02CTC89LAX/p1700208196154229). 2. For singular tests to properly show up with an owner in the Elementary dashboard, you should use the
depends_on
expression to relate the test to a model that has an owner:
Copy code
sql -- depends_on: {{ ref('model_name') }}  <test query here>
3. If your singular test depends on multiple models, this can cause issues with owner assignment in Elementary, as the platform currently expects a test to be associated with one model [Link to forum discussion](https://slack.com/archives/C02CTC89LAX/p1700208196154229). 4. After making these changes, you'll need to run the test so Elementary can pick up the changes [Link to forum discussion](https://slack.com/archives/C02CTC89LAX/p1675867987431539). The Elementary team is aware of these limitations and has plans to improve support for test-level owners in the future. I hope this helps with organizing your Elementary dashboard! Is there anything specific about implementing this that you'd like me to clarify?