Skip to content

Dbt cloud explore #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions models/example/my_first_dbt_model.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

{{ config(materialized='table') }}

with source_data as (
/*with source_data as (

select 1 as id
union all
Expand All @@ -20,8 +20,8 @@ with source_data as (
select *
from source_data

/*
Uncomment the line below to remove records with null `id` values
*/

-- where id is not null

-- where id is not null*/

select * from pagila.dbt_aanubhava.ayush
4 changes: 3 additions & 1 deletion models/example/my_second_dbt_model.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@

select *
from {{ ref('my_first_dbt_model') }}
where id = 1
where O_ORDERKEY = 1200003

/*select * from ayush limit 100*/
5 changes: 3 additions & 2 deletions models/example/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ models:
- name: my_first_dbt_model
description: "A starter dbt model"
columns:
- name: id
- name: O_ORDERKEY
description: "The primary key for this table"
tests:
- unique
Expand All @@ -14,8 +14,9 @@ models:
- name: my_second_dbt_model
description: "A starter dbt model"
columns:
- name: id
- name: O_ORDERKEY
description: "The primary key for this table"
tests:
- unique
- not_null

1 change: 1 addition & 0 deletions models/example/seedcheck.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select country_name from {{ ref('country_codes') }}
3 changes: 3 additions & 0 deletions models/example/test.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select *
from {{ ref('my_first_dbt_model') }}
where O_ORDERKEY != 1200004
4 changes: 4 additions & 0 deletions seeds/country_codes.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
country_code,country_name
US,United States
CA,Canada
GB,United Kingdom
14 changes: 14 additions & 0 deletions seeds/schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2

seeds:
- name: country_codes
description: A mapping of two letter country codes to country names
columns:
- name: country_code
tests:
- unique
- not_null
- name: country_name
tests:
- unique
- not_null