Building a Target Schema
Learn how to create effective target schemas for your data transformations
If you are building your schema or need to customize an existing one, this guide will walk you through the process.
Schema Basics
Target schemas in Lume use YAML format to define your desired output structure. A target schema requires a models section and each entry requires a name field and columns section. Each column entry contains the following:
- A field name
- A clear description of the field’s business meaning and context
- A set of tests to validate your transformed data
Write clear, specific descriptions that explain your business’s unique requirements and context. For example, specify if “revenue” means monthly recurring revenue, annual revenue, or revenue before returns. Learn more about writing effective descriptions in our Creating Field Descriptions guide.
Types of Default Tests
The YAML schema provides built in test options: unique, not_null, accepted_values, and relationships. Here is an example using those tests for an orders model:
Lume also provides built in support for DBT Utils Tests.
Complete Example
Here’s a complete target schema example:
Best Practices
- Clear Descriptions: Write clear, specific descriptions that explain the business meaning of each field
- Test Rules: Add test rules where appropriate to ensure data quality
- Consistent Naming: Use consistent field naming conventions throughout your schema
Remember: Focus on describing what each field means, not how to transform it. Lume handles the transformation logic automatically!
Lume currently does not support custom test and macros.
- ❌
our_custom_macros_test
- ✅
not_null
- ✅
unique