Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

recce

recce is a environment diff tool for dbt

Features

  1. Support the same dbt adapter framework as dbt.
  2. Support both Web UI & CLI
  3. Lineage diff

Use cases

  1. When developing, we can check the new result by comparing against the production one.
  2. When reviewing PR, you can understand the change impacts.
  3. When trouble shooting, you can run adhoc dif query to find the root causes.

Usage

Prerequisites

You have to have at least two environments in your dbt project. For example, one is for developing and another is for production. You can prepare two targets with separate schemas in you dbt profile. Here is profiles.yml example

jaffle_shop:
  target: dev
  outputs:
    dev:
      type: duckdb
      path: jaffle_shop.duckdb
      schema: dev
    prod:
      type: duckdb
      path: jaffle_shop.duckdb
      schema: main

Getting Started

  1. Installation

    git clone git@github.com:InfuseAI/recce.git
    cd recce
    pip install -e .
    
  2. Put the manifest.json of production (or any environment you would like to diff) in the target-base/ folder. manifest.json is one of the generated artifacts for each dbt command execution. You can find it in target/ folder by default.

  3. Develop your awesome features

    dbt run
    
  4. Run the recce command

    recce server
    
  5. Review the linage diff.

  6. Switch to query tab, Write and run a query

    select * from {{ ref('mymodel') }}
    

    where ref is a Jinja macro to reference a model name.

Under the hood, recce uses the manifest.json under target/ and target-base/ to geenrate query and execute.

Run Query Diff

You can either run in Web UI

recce server

or run in CLI

recce diff --sql 'select * from {{ ref('mymodel') }}'

Specify the primary key columns

In the query diff, we use primary key columns as the basis for identifying the same record on both sides.

There are two ways to specify the primary key

  1. Define in the SQL: Add the config macro in your sql.

    {{
       config( primary_key=['DATE_WEEK', 'COUNTRY'])
    }}
    
    select ...
    
  2. Select in the query result: In the Web UI, you can click the key icons in the column headers to toggle if a column is a primary key.

Q&A

Q: How recce connect to my data warehouse? Does recce support my data warehouse?

recce use the dbt adapter to connect to your warehouse. So it should work for your data warehouse.

Q: What credential does recce connect to the two environments?

Recce uses the same target in the profile to connect your warehouse. If you use the default target dev, it use the credentials to connect to both environments. So please make sure that the credential able to access both environments.

Metadata

Release files for recce-nightly 0.1.0.20231124a32608

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for recce-nightly 0.1.0.20231124a32608
File Size Uploaded
recce-nightly-0.1.0.20231124a32608.tar.gz 579.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for recce-nightly 0.1.0.20231124a32608
File Interpreter ABI Platform
recce_nightly-0.1.0.20231124a32608-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / recce-nightly-0.1.0.20231124a32608.tar.gz

Download URL recce-nightly-0.1.0.20231124a32608.tar.gz
Size 579.7 kB
Tags Source
SHA-256 checksum
How to use checksums
faaac6833f8660e9f00cba2ccc55490801171ab01c28d14490602e9c26092227
BLAKE2b-256 checksum
How to use checksums
891ca7450dea0c411b2a6a9a0fb39006877228f539fa3d788ef12943eb606ca2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / recce_nightly-0.1.0.20231124a32608-py3-none-any.whl

Download URL recce_nightly-0.1.0.20231124a32608-py3-none-any.whl
Size 587.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd972109828804a5b02162d736552b110985d429ea357c7e1ec59d42145fb2f6
BLAKE2b-256 checksum
How to use checksums
67abd0dc2745dd547a2714c1843568f5b294d6621cceef94500722073c4bc7e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page