What if you could fix all your data source errors by changing just one simple file?
Configuring sources in YAML in dbt - Why You Should Know This
Imagine you have many data tables from different places, and you need to tell your project where each table lives by writing long lists of details in many places.
Manually tracking each data source in code is slow and confusing. You might forget to update a table name or location, causing errors that are hard to find.
Using YAML to configure sources lets you keep all source details in one clear, simple file. This makes it easy to update and reuse source info without mistakes.
SELECT * FROM database.schema.table_name; -- Hard to track and update source details scattered in SQL
sources:
- name: my_source
tables:
- name: table_name
-- Reference source in models with {{ source('my_source', 'table_name') }}It enables clean, centralized source management that makes your data projects easier to maintain and less error-prone.
A data analyst working on sales reports can update the source location in one YAML file, and all reports automatically use the new data without changing each SQL query.
Manual source tracking is slow and error-prone.
YAML centralizes source info in one place.
This makes data projects easier to update and maintain.