Thingies
This commit is contained in:
parent
1e53b3895c
commit
bccbff7205
3 changed files with 41 additions and 0 deletions
27
code_thingies/dbtlearn/models/schema.yml
Normal file
27
code_thingies/dbtlearn/models/schema.yml
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
version: 2
|
||||||
|
|
||||||
|
models:
|
||||||
|
- name: dim_listings_cleansed
|
||||||
|
columns:
|
||||||
|
- name: listing_id
|
||||||
|
tests:
|
||||||
|
- unique
|
||||||
|
- not_null
|
||||||
|
|
||||||
|
- name: host_id
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
- relationships:
|
||||||
|
to: ref('dim_hosts_cleansed')
|
||||||
|
field: host_id
|
||||||
|
|
||||||
|
- name: room_type
|
||||||
|
tests:
|
||||||
|
- accepted_values:
|
||||||
|
values: [
|
||||||
|
'Entire home/apt',
|
||||||
|
'Private room',
|
||||||
|
'Shared room',
|
||||||
|
'Hotel room'
|
||||||
|
]
|
||||||
|
|
||||||
9
code_thingies/dbtlearn/tests/consistent_created_at.sql
Normal file
9
code_thingies/dbtlearn/tests/consistent_created_at.sql
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
SELECT *
|
||||||
|
FROM
|
||||||
|
{{ ref('fact_reviews') }} fr
|
||||||
|
LEFT JOIN
|
||||||
|
{{ ref('dim_listings_cleansed') }} dl
|
||||||
|
ON
|
||||||
|
fr.listing_id = dl.listing_id
|
||||||
|
WHERE
|
||||||
|
fr.review_date < dl.created_at
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
SELECT *
|
||||||
|
FROM
|
||||||
|
{{ ref('dim_listings_cleansed') }}
|
||||||
|
WHERE
|
||||||
|
mininum_nights < 1
|
||||||
Loading…
Add table
Add a link
Reference in a new issue