dbt - Analytics Engineering Certification Study Guide

    6: Implementing and maintaining external dependencies

    This chapter covers the three external surfaces that connect a dbt project to the world outside its own DAG: exposures that declare downstream BI and ML consumers, source freshness checks that enforce SLAs on upstream loaders, and package dependencies managed through `packages.yml` and `dbt deps`. Each surface has a YAML declaration, a CLI command that activates it, and a set of failure modes that the exam treats as recurring traps.

    Learning Objectives

    By the end of this chapter, you will be able to:

    • Declare dbt exposures with the correct type, owner, maturity, url, and depends_on keys, and reason about how the exposure appears in dbt docs and how it participates in selector expressions such as +exposure:name.
    • Configure source freshness thresholds against a loaded_at_field, including warn_after and error_after with count and period, the filter argument, the loaded_at_query override, and the source-level versus table-level cascade.
    • Run dbt source freshness against single sources, full source families, and selector expressions, and read the resulting sources.json artifact to triage stale data.
    • Manage package dependencies in packages.yml using hub, git, and local install methods, pin versions through SemVer ranges, install with dbt deps, and reason about lock files, transitive dependencies, and adapter compatibility.

    Executive Summary

    • Exposures sit at the tail of the DAG and declare the downstream artifact (dashboard, application, ML feature store, notebook) that consumes one or more dbt models, sources, or metrics, giving graph operators such as +exposure:tableau_revenue_dashboard a way to build only what feeds a specific consumer.
    • Source freshness pushes the SLA enforcement back to the loader by checking the maximum loaded_at_field value against warn_after and error_after thresholds, surfacing late-arriving data before a downstream model silently runs on stale rows.
    • Package dependencies declared in packages.yml install into dbt_packages/ and merge into the project graph at parse time, which means a package model is treated as a first-class dbt node with its own materialization, tests, and lineage.
    • The three surfaces share a single pattern: a YAML declaration, a CLI activation step, and a JSON artifact under target/ that records the result, and the exam tests how those three artifacts compose against the broader build workflow described in earlier chapters.

    Assumptions

    • The reader has authored sources, models, and tests as covered in earlier chapters and is comfortable with ref(), source(), dbt build, state:modified+, and slim CI mechanics.
    • All code examples target a current stable dbt version (1.8 or later) where data_tests: is the canonical key and the source freshness block is configured under sources: in YAML rather than the deprecated top-level freshness: shorthand.
    • Warehouse-specific behavior is called out explicitly where Snowflake, BigQuery, Databricks, Redshift, and Postgres diverge; otherwise examples are warehouse-neutral.
    • Package examples use real package names from hub.getdbt.com (dbt_utils, dbt_expectations, dbt_codegen, audit_helper) without asserting specific package version numbers, since SemVer ranges drift across releases.

    Sections in this chapter

    1. Free
    2. Free with account
    3. Free with account
    4. Free with account