LogoLogo
  • 🦩Overview
  • 💾Datasets
    • Overview
    • Core Concepts
      • Columns & Annotations
      • Type & Property Mappings
      • Relationships
    • Basic Datasets
      • dbt Integration
      • Sigma Integration
      • Looker Integration
    • SaaS Datasets
    • CSV Datasets
    • Streaming Datasets
    • Entity Resolution
    • AI Columns
      • AI Prompts Recipe Book
    • Enrichment Columns
      • Quick Start
      • HTTP Request Enrichments
    • Computed Columns
    • Version Control
  • 📫Syncs
    • Overview
    • Triggering & Scheduling
    • Retry Handling
    • Live Syncs
    • Audience Syncs
    • Observability
      • Current Sync Run Overview
      • Sync History
      • Sync Tracking
      • API Inspector
      • Sync Alerts
      • Observability Lake
      • Datadog Integration
      • Warehouse Writeback
      • Sync Lifecycle Webhooks
      • Sync Dry Runs
    • Structuring Data
      • Liquid Templates
      • Event Syncs
      • Arrays and Nested Objects
  • 👥Audience Hub
    • Overview
    • Creating Segments
      • Segment Priorities
      • Warehouse-Managed Audiences
    • Experiments and Analysis
      • Audience Match Rates
    • Activating Segments
    • Calculated Columns
    • Data Preparation
      • Profile Explorer
      • Exclusion Lists
  • 🧮Data Sources
    • Overview
    • Available Sources
      • Amazon Athena
      • Amazon Redshift
      • Amazon S3
      • Azure Synapse
      • ClickHouse
      • Confluent Cloud
      • Databricks
      • Elasticsearch
      • Kafka
      • Google AlloyDB
      • Google BigQuery
      • Google Cloud SQL for PostgreSQL
      • Google Pub/Sub
      • Google Sheets
      • Greenplum
      • HTTP Request
      • HubSpot
      • Materialize
      • Microsoft Fabric
      • MotherDuck
      • MySQL
      • PostgreSQL
      • Rockset
      • Salesforce
      • SingleStore
      • Snowflake
      • SQL Server
      • Trino
  • 🛫Destinations
    • Overview
    • Available Destinations
      • Accredible
      • ActiveCampaign
      • Adobe Target
      • Aha
      • Airship
      • Airtable
      • Algolia
      • Amazon Ads DSP (AMC)
      • Amazon DynamoDB
      • Amazon EventBridge
      • Amazon Pinpoint
      • Amazon Redshift
      • Amazon S3
      • Amplitude
      • Anaplan
      • Antavo
      • Appcues
      • Apollo
      • Asana
      • AskNicely
      • Attentive
      • Attio
      • Autopilot Journeys
      • Azure Blob Storage
      • Box
      • Bloomreach
      • Blackhawk
      • Braze
      • Brevo (formerly Sendinblue)
      • Campaign Monitor
      • Canny
      • Channable
      • Chargebee
      • Chargify
      • ChartMogul
      • ChatGPT Retrieval Plugin
      • Chattermill
      • ChurnZero
      • CJ Affiliate
      • CleverTap
      • ClickUp
      • Constant Contact
      • Courier
      • Criteo
      • Crowd.dev
      • Customer.io
      • Databricks
      • Delighted
      • Discord
      • Drift
      • Drip
      • Eagle Eye
      • Emarsys
      • Enterpret
      • Elasticsearch
      • Facebook Ads
      • Facebook Product Catalog
      • Freshdesk
      • Freshsales
      • Front
      • FullStory
      • Gainsight
      • GitHub
      • GitLab
      • Gladly
      • Google Ads
        • Customer Match Lists (Audiences)
        • Offline Conversions
      • Google AlloyDB
      • Google Analytics 4
      • Google BigQuery
      • Google Campaign Manager 360
      • Google Cloud Storage
      • Google Datastore
      • Google Display & Video 360
      • Google Drive
      • Google Search Ads 360
      • Google Sheets
      • Heap.io
      • Help Scout
      • HTTP Request
      • HubSpot
      • Impact
      • Insider
      • Insightly
      • Intercom
      • Iterable
      • Jira
      • Kafka
      • Kevel
      • Klaviyo
      • Kustomer
      • Labelbox
      • LaunchDarkly
      • LinkedIn
      • LiveIntent
      • Loops
      • Mailchimp
      • Mailchimp Transactional (Mandrill)
      • Mailgun
      • Marketo
      • Meilisearch
      • Microsoft Advertising
      • Microsoft Dynamics
      • Microsoft SQL Server
      • Microsoft Teams
      • Mixpanel
      • MoEngage
      • Mongo DB
      • mParticle
      • MySQL
      • NetSuite
      • Notion
      • OneSignal
      • Optimizely
      • Oracle Database
      • Oracle Eloqua
      • Oracle Fusion
      • Oracle Responsys
      • Orbit
      • Ortto
      • Outreach
      • Pardot
      • Partnerstack
      • Pendo
      • Pinterest
      • Pipedrive
      • Planhat
      • PostgreSQL
      • PostHog
      • Postscript
      • Productboard
      • Qualtrics
      • Radar
      • Reddit Ads
      • Rokt
      • RollWorks
      • Sailthru
      • Salesforce
      • Salesforce Commerce Cloud
      • Salesforce Marketing Cloud
      • Salesloft
      • Segment
      • SendGrid
      • Sense
      • SFTP
      • Shopify
      • Singular
      • Slack
      • Snapchat
      • Snowflake
      • Split
      • Sprig
      • Stripe
      • The Trade Desk
      • TikTok
      • Totango
      • Userflow
      • Userpilot
      • Vero Cloud
      • Vitally
      • Webhooks
      • Webflow
      • X Ads (formerly Twitter Ads)
      • Yahoo Ads (DSP)
      • Zendesk
      • Zoho CRM
      • Zuora
    • Custom & Partner Destinations
  • 📎Misc
    • Credits
    • Census Embedded
    • Data Storage
      • Census Store
        • Query Census Store from Snowflake
        • Query Census Store locally using DuckDB
      • General Object Storage
      • Bring Your Own Bucket
        • Bring your own S3 Bucket
        • Bring your own GCS Bucket
        • Bring your own Azure Bucket
    • Developers
      • GitLink
      • Dataset API
      • Custom Destination API
      • Management API
    • Security & Privacy
      • Login & SSO Settings
      • Workspaces
      • Role-based Access Controls
      • Network Access Controls
      • SIEM Log Forwarding
      • Secure Storage of Customer Credentials
      • Digital Markets Act (DMA) Consent for Ad Platforms
    • Health and Usage Reporting
      • Workspace Homepage
      • Product Usage Dashboard
      • Observability Toolkit
      • Alerts
    • FAQs
Powered by GitBook
On this page
  • Setting it up
  • Managing dbt versions
  • Unsupported features
  • dbt Continuous Integration (CI) Checks in GitHub
  • Installing CI Checks in GitHub
  • Coordinating with dbt Cloud
  • Required data warehouse permissions
  • Additional permissions when using BigQuery Service Account Key

Was this helpful?

  1. Datasets
  2. Basic Datasets

dbt Integration

Use Census directly with dbt through the native dbt integration.

PreviousBasic DatasetsNextSigma Integration

Last updated 2 months ago

Was this helpful?

Census supports connecting to an existing dbt project hosted in GitHub or GitLab, which allows you keep all your source code & transforms in a single repository while leveraging Census' functionality. Census is designed to work hand-in-hand with dbt Cloud or any other dbt runner.

To connect your dbt project you'll first need a source connection within Census. Once you have a source configured you can connect your dbt project from the Projects button.

Setting it up

Here are the instructions for connecting a dbt project:

  1. Connect to your repository in GitHub or GitLab. If you’d prefer to use a different service, please let us know!

  2. Select the branch you’d like Census to use. Census will refresh the project on a regular basis and detect any changes to your models. You can force a refresh at any point from the models' page.

  3. Specify the database and schema parameters used when compiling models. These values should be the same values you use in the profiles.yml file for your production dbt runs. You may need to ensure that your Census data warehouse connection has read access to intermediate tables produced by your dbt run.

  4. Customize optional parameters:

    1. The Census model selector. Any model exposed to Census becomes available as a source for syncing your data to external tools. By default, Census looks for models with the census tag but you can customize the filter. Example selectors:

      • All models with a tag: tag:census

      • All models in a directory: path/to/models

      • All models: *

    2. Target Profile Name. Provide Census with your production profile's name if this value is used as a variable in a custom generate_schema_name macro or other location. Otherwise, leave this value as default.

    3. Environment Variables. Use the Environment Variable editor to specify the values that Census should use when compiling your dbt models.

Once you’ve configured your project repository, Census will analyze your project and display the models you’ve made available. You’re now ready to start using these models as part of Census syncs!

Managing dbt versions

require-dbt-version: ">=1.6.0,<1.7.0"

A few additional notes:

  • If this field is not specified the latest available version will be used.

  • We do not recommend you specify a single patch-level dbt version (for example: require-dbt-version: 1.6.0) as this can cause your project to break when newer versions are adopted.

  • If Census does not support a version the matches the conditions in require-dbt-version field, the project will not compile successfully.

  • If Census supports multiple dbt versions that match the requirements, the latest version supported by Census will be used.

Alternatively, you can configure your dbt project in Census to use a specific dbt version (note that this version must be within the supported version range defined in your dbt_project.yml if one is specified). You can set this by selecting a specific version in the dbt Version dropdown menu with in your dbt project's configuration in Census.

Note that setting an version override may cause issues if the Census configured value falls behind your project configuration. We recommend you provide the support values using require-dbt-version instead.

Census ignores the optional version and config-version fields in dbt_project.yml.

Unsupported features

Our dbt integration is designed to pair nicely with your existing dbt runner, whether dbt Cloud or self-hosted. We do this by using the dbt compile command rather than the typical dbt run and then make use of the compiled output only.

As a result, there's several dbt features that Census does not make use of. These include:

  • Materialization directives. Census doesn’t currently materialize your tables back to your data warehouse. Census will however use materialized tables by your dbt runner to speed up the execution

  • Pre and post hooks

  • Non-public packages

dbt Continuous Integration (CI) Checks in GitHub

For dbt models used in Census syncs, Census can check whether you are going to drop, rename, or move a model that will end up breaking an active sync in your account. When a Pull Request (or commit to a Pull Request) is created, dbt CI Checks will help ensure that your dbt development never unexpectedly breaks downstream Census syncs.

Installing CI Checks in GitHub

To enable these CI checks, navigate to your dbt integration in Census and click "Enable CI/CD Tests in GitHub". Note that Census will require the checks:read permission to install.

Once you enable CI checks, Census will automatically run a sample check on a PR. You can then view the PR to see the results of the check.

If any tests do not pass, you can click Details to view more information about the results. You'll see a report of any broken models and their dependent syncs, with links to investigate these syncs further in Census.

Coordinating with dbt Cloud

Required data warehouse permissions

Census doesn't necessarily require the same permissions your dbt project needs because Census only runs the models you've exposed to Census during set up. Census only requires read access to your selected models and any of their materialized dependencies. That means you can use dbt's materialize configuration flag to create permissions boundaries. Once materialized dependencies are generated by dbt runner, Census will reference the materialized results when accessing your models.

Additional permissions when using BigQuery Service Account Key

For more information on selector syntax, see .

Census currently supports the following dbt versions: 1.7, 1.8, and 1.9. We announce new version support in our , and we aim to add support for a new dbt version no more than four weeks after its release by dbt Labs.

To determine your dbt version, Census uses the field (if specified) in your project's dbt_project.yml. We recommend you pin your dbt project to the minor version range as dbt recommends. For example, the following configuration would ping your project to version 1.6:

Census does not currently support dbt regions other than North America multi-tenant. dbt regions described in .

Census does not currently support dbt regions other than North America multi-tenant.Further information about dbt regions in .

If you're using dbt Cloud to run your dbt project, our integration goes even further. You can configure Census to automatically run syncs whenever your models have been rebuilt. See our documentation on .

If you're using BigQuery with Service Account Key JSON, you'll need to grant your service account one additional role: roles/iam.serviceAccountTokenCreator. This permission is used by dbt to authenticate with BigQuery when compiling models. For more details, see .

💾
dbt’s Model Selector Syntax
changelog
require-dbt-version
documentation here
documentation here
dbt's documentation
connecting and configuring dbt Cloud
You can find dbt Checks in a new section of your dbt integration, under "Automatic tests in dbt".
A detailed view of the test failures.