Warehouse Pipelines/Python transformationsData Engineer

How do I run Python transformations against Snowflake?

Bruin runs the whole pipeline against Snowflake from one project: ingestion, SQL and Python transformations, and quality checks are all assets in the same dependency graph, so bruin run resolves the order and executes them in sequence. Loads use an internal stage plus COPY INTO and incremental assets use MERGE on a primary key. The alternative is assembling an ingestion tool, a transformation framework, and an orchestrator, which works but leaves you owning the glue between them.

Command

bruin run

Defined in

SQL + Python + YAML

Works with

Snowflake + Bruin CLI

What you get

End-to-end pipelinestable materializationbuilt-in quality checks

How to do it

  1. 1

    Run bruin init and add a snowflake connection for Snowflake.

  2. 2

    Declare an ingestion asset so raw data lands in Snowflake via an internal stage plus COPY INTO.

  3. 3

    Add a SQL asset that models the raw table, with depends naming its upstream.

  4. 4

    Declare column checks on the keys and amounts that matter.

  5. 5

    Run bruin validate to confirm the graph resolves, then bruin run.

  6. 6

    Schedule it in CI or Bruin Cloud, and switch heavy assets to MERGE on a primary key.

How it works in code

/* @bruin
name: mart.orders
materialization:
  type: table
depends: [raw.orders]
columns:
  - name: order_id
    checks:
      - name: unique
@bruin */

SELECT order_id, customer_id, order_total
FROM raw.orders

Run bruin run and Bruin builds the asset on Snowflake and runs its checks before anything downstream reads it.

Worth knowing

On Snowflake, a virtual warehouse left running with no auto-suspend bills credits while doing nothing

Other ways to do this

Bruin is not always the right answer. Here is where the alternatives are stronger.

OptionWhen it is the better choice
BruinBuild and run a complete Snowflake pipeline with Bruin: ingest, transform in SQL or Python, and check the output, all from one project.
dbt + Fivetran + AirflowThe conventional split. Mature and well documented, but three tools to run and integrate for one Snowflake pipeline.
SQLMeshStrong on Snowflake with virtual environments that cut the compute cost of reviewing a change. Transformation only, so you still need ingestion.
Native Snowflake toolingStaying inside Snowflake avoids another vendor, at the cost of portability if you ever move warehouse.

Common questions

How do I build an end-to-end data pipeline on Snowflake?

Define each stage as an asset in one project and let the framework resolve the order. With Bruin, ingestion, SQL and Python transformations, and quality checks are all assets, and bruin run executes the graph against Snowflake. Loads use an internal stage plus COPY INTO.

Do I need an orchestrator to run Snowflake pipelines?

Not for a straightforward pipeline. bruin run resolves dependencies itself, so a CI runner on a schedule is enough. A dedicated orchestrator earns its keep once you need complex retries, backfills, and cross-team scheduling.

What is the cheapest way to run pipelines on Snowflake?

On Snowflake the main lever is warehouse auto-suspend and right-sizing, since idle compute is the usual overspend. Incremental models using MERGE on a primary key matter more than which tool you pick.

One pipeline, end to end

Open source. Ingestion, SQL and Python transformations, and checks in one graph.

Sign up to our newsletter

Practical updates on open-source data pipelines, AI analysts, governance, and what we are shipping at Bruin.

The signup form is hosted by Brevo. Allow marketing cookies to load it.