Combining Components with Pythonic definitions
As your Dagster project grows, you may want to leverage Components for standardized data pipelines while still maintaining traditional @dg.asset definitions for custom logic. This guide shows how to combine both approaches in a single project using Definitions.merge.
When to use this pattern
This pattern is useful when you:
- Want to use Components for standardized integrations (Sling, dbt, etc.), but need custom Python logic for specific transformations
- Are migrating an existing project to Components incrementally
- Have team members who prefer working with Python code while others benefit from Components' declarative approach
Example project structure
Here's a project that combines Components with traditional Pythonic assets:
tree my_project/src/my_project
my_project/src/my_project
├── __init__.py
├── definitions.py