Skip to content

Commit

Permalink
Rename vw_ratio_stats to ratio_stats_input
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsnow committed May 2, 2024
1 parent 487b8a7 commit 15b9af7
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- View containing ratios by pin, intended to feed the
-- glue job 'reporting-ratio_stats'.
-- ratio_stats dbt python model
{{
config(
materialized='table'
Expand Down
18 changes: 9 additions & 9 deletions dbt/models/reporting/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ reporting Tableau dashboards.
`property_group`
{% enddocs %}

# ratio_stats_input

{% docs table_ratio_stats_input %}
View to feed the Python dbt job that creates the `reporting.ratio_stats` table.
Feeds public reporting assets.

**Primary Key**: `year`, `pin`, `assessment_stage`
{% enddocs %}

# res_report_summary

{% docs table_res_report_summary %}
Expand Down Expand Up @@ -79,15 +88,6 @@ The assessment stages are:
**Primary Key**: `year`, `pin`, `stage_name`
{% enddocs %}

# vw_ratio_stats

{% docs view_vw_ratio_stats %}
View to feed the `reporting.ratio_stats` table and Glue job.
Feeds public reporting assets.

**Primary Key**: `year`, `pin`, `assessment_stage`
{% enddocs %}

# vw_res_report_summary

{% docs view_vw_res_report_summary %}
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/reporting/reporting.ratio_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def report_summarise(df, geography_id, geography_type):
def model(dbt, spark_session):
dbt.config(materialized="table")

input = dbt.ref("reporting.vw_ratio_stats")
input = dbt.ref("reporting.ratio_stats_input")

df = pd.concat(
[
Expand Down
1 change: 1 addition & 0 deletions dbt/models/reporting/reporting.ratio_stats_input.sql
1 change: 0 additions & 1 deletion dbt/models/reporting/reporting.vw_ratio_stats.sql

This file was deleted.

12 changes: 6 additions & 6 deletions dbt/models/reporting/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,31 +165,31 @@ models:
where: CAST(year AS int) < {{ var('test_qc_year_start') }}
error_if: ">21" # as of 2024-04-01

- name: reporting.vw_ratio_stats
description: '{{ doc("view_vw_ratio_stats") }}'
- name: reporting.ratio_stats_input
description: '{{ doc("table_ratio_stats_input") }}'
tests:
- unique_combination_of_columns:
name: reporting_vw_ratio_stats_unique_by_keys
name: reporting_ratio_stats_input_unique_by_keys
combination_of_columns:
- pin
- year
- assessment_stage
- sale_price
- expression_is_true:
name: reporting_vw_ratio_stats_no_nulls
name: reporting_ratio_stats_input_no_nulls
expression: |
property_group IS NOT NULL
AND assessment_stage IS NOT NULL
AND triad IS NOT NULL
AND township_code IS NOT NULL
- expression_is_true:
name: reporting_vw_ratio_stats_sale_year_equals_year_minus_one
name: reporting_ratio_stats_input_sale_year_equals_year_minus_one
expression: CAST(sale_year AS INTEGER) = CAST(year AS INTEGER) - 1
additional_select_columns:
- sale_year
- year
- expression_is_true:
name: reporting_vw_ratio_stats_ratio_greater_than_zero
name: reporting_ratio_stats_input_ratio_greater_than_zero
expression: ratio >= 0
additional_select_columns:
- ratio
Expand Down

0 comments on commit 15b9af7

Please sign in to comment.