chore: clean up dbt

This commit is contained in:
Stijnvandenbroek
2026-03-06 11:55:44 +00:00
parent 732e50924e
commit 19f35d4eb5
6 changed files with 49 additions and 48 deletions

View File

@@ -18,7 +18,7 @@ models:
constraints:
- type: not_null
- type: unique
tests:
data_tests:
- unique
- not_null
- name: tiny_id
@@ -30,7 +30,7 @@ models:
- name: city
description: City name.
data_type: text
tests:
data_tests:
- not_null
- name: postcode
description: Dutch postal code.
@@ -53,12 +53,12 @@ models:
- name: status
description: Listing status.
data_type: text
tests:
data_tests:
- not_null
- name: offering_type
description: Buy or rent.
data_type: text
tests:
data_tests:
- not_null
- name: object_type
description: Property type.
@@ -146,12 +146,12 @@ models:
data_type: boolean
constraints:
- type: not_null
tests:
data_tests:
- not_null
- name: ingested_at
description: Timestamp when the raw row was first written.
data_type: timestamptz
constraints:
- type: not_null
tests:
data_tests:
- not_null

View File

@@ -11,6 +11,7 @@ models:
unique_key: global_id
on_schema_change: fail
schema: elo
alias: sample_listings
contract:
enforced: true
meta:
@@ -23,7 +24,7 @@ models:
constraints:
- type: not_null
- type: unique
tests:
data_tests:
- unique
- not_null
- relationships:

View File

@@ -18,7 +18,7 @@ models:
constraints:
- type: not_null
- type: unique
tests:
data_tests:
- unique
- not_null
- name: tiny_id
@@ -35,7 +35,7 @@ models:
data_type: text
constraints:
- type: not_null
tests:
data_tests:
- not_null
- name: postcode
description: Dutch postal code.
@@ -66,7 +66,7 @@ models:
data_type: text
constraints:
- type: not_null
tests:
data_tests:
- not_null
- name: construction_type
description: Construction method.
@@ -80,7 +80,7 @@ models:
- name: living_area
description: Interior floor area in m².
data_type: integer
tests:
data_tests:
- dbt_utils.expression_is_true:
expression: "> 0"
where: "living_area is not null"
@@ -117,7 +117,7 @@ models:
- name: current_price
description: Current asking or rental price in euros.
data_type: bigint
tests:
data_tests:
- dbt_utils.expression_is_true:
expression: "> 0"
where: "current_price is not null"
@@ -138,7 +138,7 @@ models:
data_type: boolean
constraints:
- type: not_null
tests:
data_tests:
- not_null
- name: photo_count
description: Number of photos on the listing.
@@ -154,7 +154,7 @@ models:
data_type: text
constraints:
- type: not_null
tests:
data_tests:
- not_null
- name: publication_date
description: Listing publication date.
@@ -164,12 +164,12 @@ models:
data_type: timestamptz
constraints:
- type: not_null
tests:
data_tests:
- not_null
- name: price_per_sqm
description: Current price divided by living area in m².
data_type: numeric
tests:
data_tests:
- dbt_utils.expression_is_true:
expression: "> 0"
where: "price_per_sqm is not null"

View File

@@ -18,32 +18,32 @@ sources:
columns:
- name: global_id
description: Funda internal listing ID.
tests:
data_tests:
- unique
- not_null
- name: title
description: Property address / title.
tests:
data_tests:
- not_null
- name: city
description: City name.
tests:
data_tests:
- not_null
- name: price
description: Asking or rental price in euros.
- name: is_active
description: False when the listing has not appeared in search results for 7+ days.
tests:
data_tests:
- not_null
- accepted_values:
values: [true, false]
- name: last_seen_at
description: Timestamp the listing was last returned by the Funda search API.
tests:
data_tests:
- not_null
- name: ingested_at
description: Timestamp when the row was first written.
tests:
data_tests:
- not_null
- name: listing_details
@@ -59,36 +59,36 @@ sources:
columns:
- name: global_id
description: Funda internal listing ID.
tests:
data_tests:
- not_null
- relationships:
to: source('raw_funda', 'search_results')
field: global_id
- name: tiny_id
description: Public ID used in Funda URLs.
tests:
data_tests:
- not_null
- name: price
description: Asking or rental price in euros.
- name: status
description: Listing status (available or sold).
tests:
data_tests:
- not_null
- accepted_values:
values: ["available", "sold", "withdrawn", "under_negotiation"]
- name: is_stale
description: True when the parent search listing is no longer active.
tests:
data_tests:
- not_null
- accepted_values:
values: [true, false]
- name: last_fetched_at
description: Timestamp of the most recent detail fetch.
tests:
data_tests:
- not_null
- name: ingested_at
description: Timestamp when the row was first written.
tests:
data_tests:
- not_null
- name: price_history
@@ -104,7 +104,7 @@ sources:
columns:
- name: global_id
description: Funda internal listing ID.
tests:
data_tests:
- not_null
- relationships:
to: source('raw_funda', 'listing_details')
@@ -113,21 +113,21 @@ sources:
description: Price at this point in time.
- name: date
description: Date of this price event.
tests:
data_tests:
- not_null
- name: source
description: Price data source (funda or woz).
tests:
data_tests:
- not_null
- accepted_values:
values: ["Funda", "WOZ"]
- name: status
description: Price event type (asking_price, sold, or woz).
tests:
data_tests:
- not_null
- accepted_values:
values: ["asking_price", "sold", "woz", "withdrawn"]
- name: ingested_at
description: Timestamp when the row was written.
tests:
data_tests:
- not_null

View File

@@ -16,7 +16,7 @@ models:
constraints:
- type: not_null
- type: unique
tests:
data_tests:
- unique
- not_null
- name: tiny_id
@@ -24,7 +24,7 @@ models:
data_type: text
constraints:
- type: not_null
tests:
data_tests:
- not_null
- name: title
description: Property address / title.
@@ -34,7 +34,7 @@ models:
data_type: text
constraints:
- type: not_null
tests:
data_tests:
- not_null
- name: postcode
description: Dutch postal code.
@@ -51,7 +51,7 @@ models:
- name: price
description: Asking or rental price in euros.
data_type: bigint
tests:
data_tests:
- dbt_utils.expression_is_true:
expression: ">= 0"
where: "price is not null"
@@ -63,14 +63,14 @@ models:
data_type: text
constraints:
- type: not_null
tests:
data_tests:
- not_null
- accepted_values:
values: ["available", "sold", "withdrawn", "under_negotiation"]
- name: offering_type
description: Buy or rent.
data_type: text
tests:
data_tests:
- not_null
- name: object_type
description: Property type (house, apartment, etc.).
@@ -87,14 +87,14 @@ models:
- name: energy_label
description: Dutch energy performance label (AG).
data_type: text
tests:
data_tests:
- accepted_values:
values: ["A4", "A3", "A2", "A1", "A", "B", "C", "D", "E", "F", "G"]
where: "energy_label is not null"
- name: living_area
description: Interior floor area in m².
data_type: integer
tests:
data_tests:
- dbt_utils.expression_is_true:
expression: "> 0"
where: "living_area is not null"
@@ -154,5 +154,5 @@ models:
data_type: timestamptz
constraints:
- type: not_null
tests:
data_tests:
- not_null

View File

@@ -15,7 +15,7 @@ models:
data_type: text
constraints:
- type: not_null
tests:
data_tests:
- not_null
- relationships:
to: ref('stg_funda_listings')
@@ -23,7 +23,7 @@ models:
- name: price
description: Price at this point in time.
data_type: bigint
tests:
data_tests:
- dbt_utils.expression_is_true:
expression: ">= 0"
where: "price is not null"
@@ -35,7 +35,7 @@ models:
data_type: text
constraints:
- type: not_null
tests:
data_tests:
- not_null
- name: price_timestamp
description: Timestamp of this price event.
@@ -45,7 +45,7 @@ models:
data_type: text
constraints:
- type: not_null
tests:
data_tests:
- not_null
- accepted_values:
values: ["Funda", "WOZ"]
@@ -54,7 +54,7 @@ models:
data_type: text
constraints:
- type: not_null
tests:
data_tests:
- not_null
- accepted_values:
values: ["asking_price", "sold", "woz", "withdrawn"]
@@ -63,5 +63,5 @@ models:
data_type: timestamptz
constraints:
- type: not_null
tests:
data_tests:
- not_null