Skip to main content

Module parse

Module parse 

Source
Expand description

The parse pass: each Binding rendered without a database, as dbt’s parse finds ref() and source(), to learn every query’s sources and the connection it runs on. Its results feed selection (-s source:), the manifest, dre ls and dre validate, none of which connect; a run repeats it with its own inputs and then holds rendering to what it found.

A query’s connection, by SPEC-011’s rule:

  • explicit: the query’s own profile: and the profile: of every source it uses. These must agree (compared as rendered names), else it’s an error naming both sides;
  • otherwise the inherited one: the Set’s, the report’s, the folder’s +profile, then default_profile (already merged into the Binding’s profile).

A source without a profile: never conflicts: it runs wherever its query runs.

Structs§

Inputs
What the parse pass renders run.*, var() and target.name with: the run’s inputs.
ParsedBinding
A Binding after the parse pass.
ParsedQuery
One query of a Binding after the parse pass.
Problem
A problem found by the parse pass, at a file and line.

Constants§

PARSE_FAILED
The code of a template the parse pass couldn’t render.

Functions§

binding
Parse one Binding: render each query without a database, then resolve its connection. vars are the Binding’s vars as the run sees them (with a schedule’s layered in).
calendar
The run’s calendar for a report: --timezone, else the schedule’s, else the report’s, else UTC.
resolver
Resolves source() for one Binding: fields rendered with limited, once each.
run_context
The run.* context a Binding renders with.
run_date
run.date: DRE_RUN_DATE, else DRE_RUN_AT’s date in the run’s timezone, else today there.