Skip to content

Configure dbt CLI

Oscar D. Garcia edited this page Aug 3, 2023 · 8 revisions

Install dbt core and BigQuery dependencies

  • Run these command from the Step4-Data-Warehouse/dbt folder
$ cd Step4-Data-Warehouse/dbt
$ pip install dbt-core dbt-bigquery  
$ dbt init
$ dbt deps 

Create a profile file

  • From the Step4-Data-Warehouse folder, run the following commands
$ cd ~
$ mkdir .dbt
$ cd .dbt
$ touch profiles.yml
$ nano profiles.yml

  • Paste the profiles file content

👉 Use your dbt cloud project project information

Analytics:
  outputs:
    dev:
      dataset: mta_data
      job_execution_timeout_seconds: 300
      job_retries: 1
      keyfile: /home/.gcp/ozkary-de-101.json
      location: us-east1
      method: service-account
      priority: interactive
      project: ozkary-de-101
      threads: 2
      type: bigquery
  target: dev

Validate the connection

$ dbt list --profile Analytics

The output should look as follows:

ozkary dbt CLI validation

Clone this wiki locally