From 39b52be0397e380a9592a4605cea909dd0bbdf99 Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Mon, 22 Sep 2025 18:23:49 +0000 Subject: [PATCH 1/5] Fix column name --- dbt/models/sale/docs.md | 2 +- dbt/models/sale/schema.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dbt/models/sale/docs.md b/dbt/models/sale/docs.md index 40643c426..be1ddb24a 100644 --- a/dbt/models/sale/docs.md +++ b/dbt/models/sale/docs.md @@ -8,7 +8,7 @@ This is the primary sales validation output table. Flags within this table should be possible to reconstruct using the other sales validation tables: `sale.group_mean`, `sale.parameter`, and `sale.metadata`. -**Primary Key**: `meta_sale_document_number`, `run_id`, `version` +**Primary Key**: `meta_sale_document_num`, `run_id`, `version` {% enddocs %} # foreclosure diff --git a/dbt/models/sale/schema.yml b/dbt/models/sale/schema.yml index ae17c5be9..cd4bfccd0 100644 --- a/dbt/models/sale/schema.yml +++ b/dbt/models/sale/schema.yml @@ -7,8 +7,8 @@ sources: - load_auto columns: - - name: meta_sale_document_number - description: '{{ doc("shared_column_document_number") }}' + - name: meta_sale_document_num + description: '{{ doc("shared_column_document_num") }}' - name: ptax_flag_original description: | Whether or not this sale was flagged on Q10 of the From fcf5be6bf12b87c77a93d8366c70e5fcc0c6c028 Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Mon, 22 Sep 2025 18:30:40 +0000 Subject: [PATCH 2/5] Update shared column ref --- dbt/models/shared_columns.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt/models/shared_columns.md b/dbt/models/shared_columns.md index 2a1c0dcb0..a0119cf80 100644 --- a/dbt/models/shared_columns.md +++ b/dbt/models/shared_columns.md @@ -1464,7 +1464,7 @@ Possible values for this variable include: ## document_number -{% docs shared_column_document_number %} +{% docs shared_column_document_num %} Deed number/document number of the sale. Serves as the unique identifier for each sale. Can be used to lookup more From 410545dafd921c5485daa4acf92520fa913da829 Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Mon, 22 Sep 2025 18:34:39 +0000 Subject: [PATCH 3/5] Revert refs --- dbt/models/sale/schema.yml | 4 ++-- dbt/models/shared_columns.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dbt/models/sale/schema.yml b/dbt/models/sale/schema.yml index cd4bfccd0..ae17c5be9 100644 --- a/dbt/models/sale/schema.yml +++ b/dbt/models/sale/schema.yml @@ -7,8 +7,8 @@ sources: - load_auto columns: - - name: meta_sale_document_num - description: '{{ doc("shared_column_document_num") }}' + - name: meta_sale_document_number + description: '{{ doc("shared_column_document_number") }}' - name: ptax_flag_original description: | Whether or not this sale was flagged on Q10 of the diff --git a/dbt/models/shared_columns.md b/dbt/models/shared_columns.md index a0119cf80..2a1c0dcb0 100644 --- a/dbt/models/shared_columns.md +++ b/dbt/models/shared_columns.md @@ -1464,7 +1464,7 @@ Possible values for this variable include: ## document_number -{% docs shared_column_document_num %} +{% docs shared_column_document_number %} Deed number/document number of the sale. Serves as the unique identifier for each sale. Can be used to lookup more From c957af60a67f967c1fd818b36e86337ee062229c Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Mon, 22 Sep 2025 18:43:40 +0000 Subject: [PATCH 4/5] Add sale_price_original_docs --- dbt/models/sale/schema.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dbt/models/sale/schema.yml b/dbt/models/sale/schema.yml index ae17c5be9..e83865fb3 100644 --- a/dbt/models/sale/schema.yml +++ b/dbt/models/sale/schema.yml @@ -9,6 +9,12 @@ sources: columns: - name: meta_sale_document_number description: '{{ doc("shared_column_document_number") }}' + - name: meta_sale_price_original + description: | + This is the original sale price pulled from default.vw_pin_sale. This is + the original sale price. We log the sale price prior to assigning flags + so this column holds a historical record of the original sale price at the + snapshot in time that we ran the flagging pipeline. - name: ptax_flag_original description: | Whether or not this sale was flagged on Q10 of the From dc7368c13fe6ac4ccedb008d0ce0e986ad91a719 Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Tue, 23 Sep 2025 20:45:05 +0000 Subject: [PATCH 5/5] Update docs --- dbt/models/sale/schema.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dbt/models/sale/schema.yml b/dbt/models/sale/schema.yml index e83865fb3..e7e221c1e 100644 --- a/dbt/models/sale/schema.yml +++ b/dbt/models/sale/schema.yml @@ -7,6 +7,12 @@ sources: - load_auto columns: + - name: group + description: | + Group string used as a unique identifier for the statistical flagging + group this sale belongs to. An example is township code, class, and + rolling window. You can join this field onto the `group_mean` table to + see more details about the group statistics. - name: meta_sale_document_number description: '{{ doc("shared_column_document_number") }}' - name: meta_sale_price_original @@ -45,6 +51,18 @@ sources: description: '{{ doc("shared_column_sv_outlier_reason") }}' - name: sv_outlier_reason3 description: '{{ doc("shared_column_sv_outlier_reason") }}' + - name: sv_price_deviation + description: | + The number of standard deviations this sale price is away from + the mean price of its group (township, class, rolling window). + This is used to determine whether or not the sale is an outlier + based on statistical deviation. We persist this column for ease in + understanding why a sale was or was not flagged as an outlier. + - name: sv_price_per_sqft_deviation + description: | + Same as sv_price_deviation, but calculated using price per sqft. + Will only be populated for res classes, since we don't have sqft + data for condos. - name: version description: '{{ doc("shared_column_sv_version") }}'