Sobes.tech
Senior

What do you usually do after the SQL for a DBT model is ready?

sobes.tech AI

Answer from AI

After the SQL for the DBT model is ready, I usually follow these steps:

  1. Model testing — run built-in DBT tests (e.g., uniqueness checks, not-null constraints) and add custom tests if necessary.
  2. Local model execution — run dbt run locally to ensure the model builds correctly and the data meets expectations.
  3. Result verification — analyze the model outputs, compare with source data or reference metrics.
  4. Documentation — update the model description in DBT, add comments and metadata for easier maintenance.
  5. Code review — submit changes for peer review to check quality and logic.
  6. Deployment and monitoring — after approval, deploy the model to production via CI/CD, set up monitoring and alerts for potential errors or anomalies.

Example of running the model:

# Run the model locally
 dbt run --models my_model

# Run tests
 dbt test --models my_model