Skip to main content

Validations

Validations refer to the process of checking whether a system or configuration meets the expected requirements or constraints. In the case of the Semantic Layer, powered by MetricFlow, there are three built-in validations — parsing, semantic, and data platform.

These validations ensure that configuration files follow the expected schema, the semantic graph doesn't violate any constraints, and semantic definitions in the graph exist in the physical table — providing effective data governance support. These three validation steps occur sequentially and must succeed before proceeding to the next step.

The code that handles validation can be found here for those who want to dive deeper into this topic.

Validations command

You can run validations from the dbt platform or the command line with the following MetricFlow commands. In dbt, you need developer credentials to run dbt sl validate-configs in the IDE or CLI, and deployment credentials to run it in CI.

# dbt platform and Fusion users in IDE / Cloud CLI
# runs parsing, semantic, and (where supported) data platform validations
dbt sl validate

# dbt Core (open source) users
# Fusion CLI users not connected to dbt platform and using local MetricFlow
# runs parsing and semantic validations
mf validate-configs

Availability by environment

Validation behavior and availability differ depending on your environment and setup:

EnvironmentWho can useParsingSemantic syntaxData platformHow to run
dbt Fusion Enginedbt platform users for full Semantic Layer features✅ *
  • Parsing validations run automatically while generating the semantic manifest.
  • When running in development, semantic syntax validations run automatically on dbt platform if dbt_cloud.yml is configured. If not, run manually using mf-validate-configs.
  • Data platform validations don't run automatically for Fusion. You must run dbt sl validate to run data platform validations.
  • Cloud CLIdbt platform usersRun any Cloud CLI command; validations execute automatically except data platform validations. You must run dbt sl validate to run data platform validations.
    dbt CoreOpen source usersUse dbt Core for parsing/builds. Run additional validation manually with the MetricFlow CLI.
    MetricFlow CLIOpen source usersRun mf validate-configs locally to validate and test metrics.
    Loading table...

    *Jobs run in Orchestration or Studio IDE run this validation automatically.

    Parsing

    In this validation step, we ensure your config files follow the defined schema for each semantic graph object and can be parsed successfully. It validates the schema for the following core objects:

    Semantic syntax

    This syntactic validation step occurs after we've built your semantic graph. The Semantic Layer, powered by MetricFlow, runs a suite of tests to ensure that your semantic graph doesn't violate any constraints. For example, we check to see if names are unique, or if metrics referenced in materialization exist. The current semantic rules we check for are:

    Data platform

    This type of validation checks to see if the semantic definitions in your semantic graph exist in the underlying physical table. To test this, we run queries against your data platform to ensure the generated SQL for semantic models, dimensions, and metrics will execute.

    We run the following checks:

    You can run semantic validations (against your semantic layer) in a CI job to guarantee any code changes made to dbt models don't break these metrics. For more information, refer to semantic validation in CI.

    Was this page helpful?

    This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

    0
    Loading