Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>DatafoldNew to Visual Studio Code? Get it now.
Datafold

Datafold

Datafold

datafold.com
|
412 installs
| (4) | Free
Datafold VSCode extension boosting productivity of data engineers
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Datafold VS Code

With the Datafold VS Code Extension, you can quickly run and diff any dbt models, view and interact with diff results in a clean GUI, and automatically diff models that change, all within your VS Code IDE.

vs_code_datafold_gif

Installation

  1. Install the Datafold VS Code Extension using the VS Code Extension tab.

vs_code_install

  1. Open up the extension's settings to set file paths for dbt profiles, your dbt project, and your Python installation.

vs_code_settings

💡 Set absolute paths in the Extension Settings to avoid any issues.

  1. Using the command palate (⌘⇧P on Mac, ⌃⇧P on Windows and Linux), install data-diff by searching for "Datafold: Install data-diff".

vs_code_install_data-diff

  • You'll be walked through a few steps including:
    • setting up your dbt_project.yml
    • setting the path to your profiles.yml
    • selecting a data warehouse
  • If you use custom schemas, just enter any text string in the "Enter your schema" step. This will populate the production_schema var in your dbt_project.yml with whatever value you entered. Then, you'll need to adjust your dbt_project.yml following the steps in the Custom Schema section in our documentation.

This is what will be added to the vars of your dbt_project.yml once setup is complete:

vars:
  data_diff:
    prod_database: YOUR_DATABASE
    prod_schema: YOUR_SCHEMA

Getting started

Running your first Data Diff

You can diff dbt models by clicking on the bird of Datafold, which reveals a sidebar containing all of your dbt models.

vs_code_sidebar

Click on any model's "play" button to run a data diff between the development and production version of the model.

💡 In order for the data diff to run, there must be a version of the model in both your production and development environments.

vs_code_first_diff

Explore value-level differences

Understand exactly which values will change if the development code is merged to production.

vs_code_diff_values_trial

Additional commands

You can search for Datafold commands by using the command palate (⌘⇧P on Mac, ⌃⇧P on Windows and Linux).

Try typing "Datafold: Diff dbt model"

💡 If a dbt model file is open, it will be diffed automatically.

💡 If a dbt model file is not open, you will be prompted to enter a model name.

vs_code_command_diff_dbt_model vs_code_command_diff_dbt_model_select

You can also diff every model that was built in your most recent dbt run.

vs_code_command_diff_dbt_run

Additional features

Watch Mode

By turning on Watch Mode, the Datafold VS Code extension will diff all models that are run in each dbt run, as you code. Simply check this box in the Extension Settings.

vs_code_watch_mode

💡 To prevent diffing too many models with Watch Mode on, be sure to select only a subset (e.g., dbt run --select dim_orgs+).

vs_code_watch_gif

Technical Notes

Required Software

  • You need to have dbt and Python 3.7 or newer installed.
  • The datafold/data-diff package will be installed as a Python package. If you have a Python extension installed, the package will be installed in the currently selected Python environment. Otherwise, it will be installed in the default Python environment. Make sure that you select the correct Python environment in the status bar using the "Python: Select Interpreter" command if you have multiple Python environments installed.

Logging

Logs can be found in the Output panel under the Datafold channel.

The extension respects the log level configured with Developer: Set Log Level command. By default, the extension uses the info log level. To see more logs for debugging, change the log level:

  • Open command palette (⌘⇧P on Mac, ⌃⇧P on Windows and Linux).
  • Launch Developer: Set Log Level command.
  • Select Datafold channel and the log level to debug.
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft