Materializing Python Assets into Your Warehouse
Return a DataFrame, let Bruin handle the rest. Learn how to use Python materialization to load data into BigQuery, Snowflake, Postgres, and more - with support for merge, append, and incremental strategies.
What
Goal - Use Python materialization to turn any Python script that returns a DataFrame into a loaded, managed table in your data warehouse. No manual to_sql, no credential wiring, no duplicate-handling code.
Audience - Data engineers who want Python assets that behave like SQL assets: typed columns, merge/append/incremental strategies, and quality checks - all driven by the asset's YAML config.
Prerequisites
- Bruin CLI installed
- A Bruin project with a configured warehouse connection (BigQuery, Snowflake, Postgres, Redshift, MSSQL, MySQL, DuckDB, etc.)
- Familiarity with Python assets - see Using the Bruin Python SDK if you're new to them
More guides
Capstone: add returns to the pipeline
Extend the project, prove the result, and assess the finished pipeline.
Describe the model in its asset definition
Keep the metric definition, owners, limits, and checked examples next to the SQL.
Load and profile the source data
Load local commerce data and check its shape before modeling it.