Bruin CLI Step 4 of 5

Bruin Core Concepts

  1. Assets6 min

Built-in variables

Every pipeline run automatically provides start date and end date variables based on the pipeline schedule. For a monthly pipeline, the start date is the beginning of the month and the end date is the end of the month.

In SQL assets

Built-in variables are injected using Jinja syntax:

WHERE pickup_datetime >= '{{ start_date }}'
  AND pickup_datetime < '{{ end_date }}'

You can preview the compiled query in the Bruin render panel to see the actual dates injected.

In Python assets

Built-in variables are provided as environment variables:

import os

start_date = os.environ["BRUIN_START_DATE"]
end_date = os.environ["BRUIN_END_DATE"]