Is this your first time submitting a feature request?
Describe the feature
Context
Since the rollout of the Union Feature in a number of Fivetran dbt packages, I've seen users have an increasing apatite for adopting the feature in the compatible packages as well as request the feature in others. This feature is great for users who have multiple datasets that are similar (maybe the user is an agency, consultancy, or company with many separated business units). However, there is one major flaw with this feature in the Fivetran dbt packages, it breaks dbt convention by not generating a source.yml for each schema/database the user passes through. Therefore, the user is not able to effectively test freshness or generate an accurate DAG 😞.
The Fivetran dbt packages with this feature use only one source.yml as a template to then be leveraged in a custom macro that ultimately passes a list of relations towards dbt_utils.union_relations(). This works great during dbt run as I mentioned, however the DAG then shows no relation to the sources (see the image below).

However, when manually adding multiple sources and naming them properly, you can see the sources are properly defined! 🎉

This is great, but I only had to define two sources. What happens when tomorrow we add another Xero dataset (in this case)? How about in a month when our company grows and we add 100 other Xero datasets?! Managing all those sources and creating the same source.yml time after time can become quite unwieldy and is not ideal. It would be great if we can somehow dynamically generate sources from a single yml file 🤯!
Feature Request
It would be great if there was a way to use Jinja (or some other tool) to dynamically generate the same source.yml for multiple datasets that are the same. I am envisioning something like the following:
## xero_schema = ['xero_mx','xero_ca']
sources:
- name: "{% for name in var('xero_schema') %}name{% endfor %}"
schema: "{% for schema in var('xero_schema') %}schema{% endfor %}"
database: "{{ var('xero_database', target.database) }}"
tables:
- name: account
The above does not work, but I imagine some way to leverage dynamic jinja to allow for a single source.yml to be reused multiple times if the structure of the schema is the same.
Describe alternatives you've considered
Manually writing the source.yml for each source. This does work, but is not scalable.
Who will this benefit?
dbt users whose companies relate to the consultancy, agency, or high growth models and see the same datasets being added over time.
Are you interested in contributing this feature?
I don't feel equipped to solve this issue, but open to helping however I can.
Anything else?
Here is the fivetran_utils macro that is called within the custom macro identified in the "Describe the Feature" section. You can see the bulk of the efforts are in place to pass a list of relations to dbt_utils.union_relations().
Is this your first time submitting a feature request?
Describe the feature
Context
Since the rollout of the Union Feature in a number of Fivetran dbt packages, I've seen users have an increasing apatite for adopting the feature in the compatible packages as well as request the feature in others. This feature is great for users who have multiple datasets that are similar (maybe the user is an agency, consultancy, or company with many separated business units). However, there is one major flaw with this feature in the Fivetran dbt packages, it breaks dbt convention by not generating a source.yml for each schema/database the user passes through. Therefore, the user is not able to effectively test freshness or generate an accurate DAG 😞.
The Fivetran dbt packages with this feature use only one source.yml as a template to then be leveraged in a custom macro that ultimately passes a list of relations towards

dbt_utils.union_relations(). This works great duringdbt runas I mentioned, however the DAG then shows no relation to the sources (see the image below).However, when manually adding multiple sources and naming them properly, you can see the sources are properly defined! 🎉

This is great, but I only had to define two sources. What happens when tomorrow we add another Xero dataset (in this case)? How about in a month when our company grows and we add 100 other Xero datasets?! Managing all those sources and creating the same source.yml time after time can become quite unwieldy and is not ideal. It would be great if we can somehow dynamically generate sources from a single yml file 🤯!
Feature Request
It would be great if there was a way to use Jinja (or some other tool) to dynamically generate the same source.yml for multiple datasets that are the same. I am envisioning something like the following:
The above does not work, but I imagine some way to leverage dynamic jinja to allow for a single source.yml to be reused multiple times if the structure of the schema is the same.
Describe alternatives you've considered
Manually writing the source.yml for each source. This does work, but is not scalable.
Who will this benefit?
dbt users whose companies relate to the consultancy, agency, or high growth models and see the same datasets being added over time.
Are you interested in contributing this feature?
I don't feel equipped to solve this issue, but open to helping however I can.
Anything else?
Here is the fivetran_utils macro that is called within the custom macro identified in the "Describe the Feature" section. You can see the bulk of the efforts are in place to pass a list of relations to
dbt_utils.union_relations().