Skip to content

Commit

Permalink
Setup multiple dbt profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
zschira committed Jan 10, 2025
1 parent bf40ffb commit 415a113
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 15 deletions.
16 changes: 13 additions & 3 deletions src/pudl/dbt/models/schema.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
version: 2

sources:
- name: pudl_nightly
- name: pudl
meta:
external_location: "https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/nightly/{name}.parquet"
external_location: |
{%- if target.name == "nightly" -%} 'https://s3.us-west-2.amazonaws.com/pudl.catalyst.coop/nightly/{name}.parquet'
{%- else -%} '{{ env_var('PUDL_OUTPUT') }}/parquet/{name}.parquet'
{%- endif -%}
tables:
- name: out_vcerare__hourly_available_capacity_factor
columns:
- name: capacity_factor_solar_pv
tests:
data_tests:
- not_null
- dbt_expectations.expect_column_max_to_be_between:
max_value: 1.02
- name: capacity_factor_offshore_wind
data_tests:
- not_null
- dbt_expectations.expect_column_max_to_be_between:
max_value: 1.00
8 changes: 8 additions & 0 deletions src/pudl/dbt/package-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
packages:
- package: calogica/dbt_expectations
version: 0.10.4
- package: dbt-labs/dbt_utils
version: 1.3.0
- package: calogica/dbt_date
version: 0.10.1
sha1_hash: 29571f46f50e6393ca399c3db7361c22657f2d6b
5 changes: 5 additions & 0 deletions src/pudl/dbt/packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
packages:
- package: calogica/dbt_expectations
version: [">=0.10.0", "<0.11.0"]
- package: dbt-labs/dbt_utils
version: [">=1.3.0", "<1.4.0"]
12 changes: 10 additions & 2 deletions src/pudl/dbt/profiles.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
pudl_dbt:
outputs:
dev:
# Define targets for nightly builds, and local ETL full/fast
# See models/schema.yml for further configuration
nightly:
type: duckdb
path: /tmp/pudl.duckdb
filesystems:
- fs: s3
etl-full:
type: duckdb
path: /tmp/pudl.duckdb
etl-fast:
type: duckdb
path: /tmp/pudl.duckdb

target: dev
target: nightly
5 changes: 0 additions & 5 deletions src/pudl/dbt/tests/schema.yml

This file was deleted.

5 changes: 0 additions & 5 deletions src/pudl/dbt/tests/vcerare_wind_cap_factor_upper_bound.sql

This file was deleted.

0 comments on commit 415a113

Please sign in to comment.