If clause in project.yml

Is there anyway possible to provide if condition in project.yml while calling a macro on run end?

I’ve already tried it in this format

on-run-end: 
  - "{{ log_dbt_results(results) if target.database == 'PDP_DEV_DOMAIN_DB'}}"

@akanksha
Yes it’s possible plz try like this in your dbt_project.yml file

on-run-end: "{{ log_dbt_results(results) if target.database == 'PDP_DEV_DOMAIN_DB'}}"

I did try like this and it worked for me

2 Likes

I’ve had problems with on-run-end because of the indentation, be sure it is in the same level as models, as Surya wrote

This format of on-run-end worked (Thanks Surya!)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.