Skip to main content
lightdash compile builds dbt or native Lightdash YAML models into explores and reports semantic errors, such as a metric referencing a dimension that does not exist. Compilation also runs inside lightdash validate, lightdash deploy, and lightdash preview, so the behaviour and flags on this page apply to those commands too. For native projects, the CLI detects the Lightdash YAML project layout and compiles without running dbt or loading a dbt profile. See Validate your YAML for the configuration and command. dbt selectors and warehouse-column probes do not apply to this path.

Choose partial or strict compilation

Lightdash uses partial compilation by default. Field, join, and set-validation failures that can be isolated are reported as warnings so the rest of the explore stays usable; failures that cannot be isolated can still produce errors. Add --no-partial-compilation to report the failures that partial compilation would otherwise isolate as errors instead. It doesn’t promote unrelated, non-blocking warnings — other generic compilation warnings stay non-blocking. If your project uses physical column references such as ${TABLE}.order_id, add --validate-warehouse-columns to check supported unquoted references with warehouse queries that return no rows. It’s opt-in because it sends those queries; whether your warehouse scans or bills for them is warehouse-dependent, and the check needs warehouse credentials and the warehouse catalog. Warehouse-column errors are reported whether partial compilation is on or off. See the CLI compilation options for the supported reference syntax and every skip condition. To report the isolated failures as errors instead, use strict compilation:
Combine it with warehouse-column validation when your project uses physical references:

Compile a subset of your dbt models

If you only use a subset of your dbt models in Lightdash, specify that subset with dbt selection syntax. For example, to only compile models with the tag lightdash:
See lightdash compile in the CLI reference for every option.

Run compilation in CI

To run lightdash compile on every pull request and catch errors before they’re merged, use the compile workflow template. Follow Compile your dbt project in Automate with CI/CD.