Skip to content

Commit

Permalink
Add addresses, row ids
Browse files Browse the repository at this point in the history
  • Loading branch information
wrridgeway committed Jan 13, 2025
1 parent 88a521f commit 7a77761
Show file tree
Hide file tree
Showing 14 changed files with 112 additions and 21 deletions.
21 changes: 0 additions & 21 deletions dbt/models/default/exposures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,6 @@ exposures:
Use cases: Alone, can characterize assessments in a given area. Can be combined with characteristic data to make more nuanced generalizations about assessments. Can be combined with sales data to conduct ratio studies.
- name: parcel_addresses
label: Parcel Addresses
type: dashboard
url: https://datacatalog.cookcountyil.gov/Property-Taxation/Assessor-Parcel-Addresses/3723-97qp
depends_on:
- ref('default.vw_pin_address')
owner:
name: Data Department
meta:
test_row_count: true
asset_id: 3723-97qp
primary_key:
- pin
- year
description: |
Situs and mailing addresses of Cook County parcels.
Notes: Refreshed monthly, data is updated as towns are mailed/certified by Valuations.
Use cases: Can be used for geocoding or joining address-level data to other datasets.
- name: parcel_sales
label: Parcel Sales
type: dashboard
Expand Down
15 changes: 15 additions & 0 deletions dbt/models/open_data/docs.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# vw_parcel_address

{% docs view_vw_parcel_address %}
Source of truth view for PIN address, both legal (property address)
and mailing (owner/taxpayer address).

### Nuance

- Mailing addresses and owner names have not been regularly updated since 2017.
- Newer properties may be missing a mailing or property address, as they
need to be assigned one by the postal service.

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

# vw_parcel_universe_current

{% docs view_vw_parcel_universe_current %}
Expand Down
21 changes: 21 additions & 0 deletions dbt/models/open_data/exposures.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
exposures:
- name: parcel_addresses
label: Parcel Addresses
type: dashboard
url: https://datacatalog.cookcountyil.gov/Property-Taxation/Assessor-Parcel-Addresses/3723-97qp
depends_on:
- ref('open_data.vw_parcel_address')
owner:
name: Data Department
meta:
test_row_count: true
asset_id: 3723-97qp
primary_key:
- pin
- year
description: |
Situs and mailing addresses of Cook County parcels.
Notes: Refreshed monthly, data is updated as towns are mailed/certified by Valuations.
Use cases: Can be used for geocoding or joining address-level data to other datasets.
- name: parcel_universe_current_year
label: Parcel Universe (Current Year)
type: dashboard
Expand Down
26 changes: 26 additions & 0 deletions dbt/models/open_data/open_data.vw_parcel_address.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-- Source of truth view for PIN address, both legal and mailing
SELECT
CONCAT(pin, year) AS row_id,
pin,
pin10,
year,
--prop_address_prefix,
--prop_address_street_number,
--prop_address_street_dir,
--prop_address_street_name,
--prop_address_suffix_1,
--prop_address_suffix_2,
--prop_address_unit_prefix,
--prop_address_unit_number,
prop_address_full,
prop_address_city_name,
prop_address_state,
prop_address_zipcode_1,
--prop_address_zipcode_2,
mail_address_name,
mail_address_full,
mail_address_city_name,
mail_address_state,
mail_address_zipcode_1
--mail_address_zipcode_2
FROM {{ ref('default.vw_pin_address') }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ for two reasons - to rename columns so that they align with Socrata API names
for easy updating, and to limit the scope of the Parcel Universe asset to
something Socrata's backend can handle. */
SELECT
CONCAT(pin, year) AS row_id,
pin,
pin10,
year,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* This view exists to rename columns so that they align with Socrata API names
for easy updating. */
SELECT
CONCAT(pin, year) AS row_id,
pin,
pin10,
year,
Expand Down
1 change: 1 addition & 0 deletions dbt/models/open_data/open_data.vw_res_condo_unit_char.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ should only be the case while condo characteristics are pulled from excel
workbooks rather than iasWorld.
*/
SELECT
CONCAT(pin, year) AS row_id,
pin,
pin10,
card,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-- View to standardize residential property characteristics for use in
-- modeling and reporting
SELECT
pin || CAST(card AS VARCHAR) || year AS row_id,
pin,
--pin10,
year,
Expand Down
31 changes: 31 additions & 0 deletions dbt/models/open_data/schema/open_data.parcel_address.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
models:
- name: open_data.vw_parcel_address
description: '{{ doc("view_vw_parcel_address") }}'

columns:
- name: mail_address_city_name
description: '{{ doc("shared_column_mail_address_city_name") }}'
- name: mail_address_full
description: '{{ doc("shared_column_mail_address_full") }}'
- name: mail_address_name
description: '{{ doc("shared_column_mail_address_name") }}'
- name: mail_address_state
description: '{{ doc("shared_column_mail_address_state") }}'
- name: mail_address_zipcode_1
description: '{{ doc("shared_column_mail_address_zipcode_1") }}'
- name: pin
description: '{{ doc("shared_column_pin") }}'
- name: pin10
description: '{{ doc("shared_column_pin10") }}'
- name: prop_address_city_name
description: '{{ doc("shared_column_prop_address_city_name") }}'
- name: prop_address_full
description: '{{ doc("shared_column_prop_address_full") }}'
- name: prop_address_state
description: '{{ doc("shared_column_prop_address_state") }}'
- name: prop_address_zipcode_1
description: '{{ doc("shared_column_prop_address_zipcode_1") }}'
- name: row_id
description: '{{ doc("shared_column_row_id") }}'
- name: year
description: '{{ doc("shared_column_year") }}'
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ models:
description: '{{ doc("shared_column_pin") }}'
- name: pin10
description: '{{ doc("shared_column_pin10") }}'
- name: row_id
description: '{{ doc("shared_column_row_id") }}'
- name: school_data_year
description: '{{ doc("shared_column_data_year") }}'
- name: school_elementary_district_geoid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ models:
description: '{{ doc("shared_column_pin") }}'
- name: pin10
description: '{{ doc("shared_column_pin10") }}'
- name: row_id
description: '{{ doc("shared_column_row_id") }}'
- name: school_data_year
description: '{{ doc("shared_column_data_year") }}'
- name: school_elementary_district_geoid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ models:
description: '{{ doc("shared_column_pin_num_landlines") }}'
- name: pin_num_lline
description: '{{ doc("shared_column_pin_num_lline") }}'
- name: row_id
description: '{{ doc("shared_column_row_id") }}'
- name: tieback_key_pin
description: '{{ doc("shared_column_tieback_key_pin") }}'
- name: tieback_proration_rate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ models:
description: '{{ doc("shared_column_pin_num_landlines") }}'
- name: recent_renovation
description: '{{ doc("shared_column_char_recent_renovation") }}'
- name: row_id
description: '{{ doc("shared_column_row_id") }}'
- name: tieback_key_pin
description: '{{ doc("shared_column_tieback_key_pin") }}'
- name: tieback_proration_rate
Expand Down
7 changes: 7 additions & 0 deletions dbt/models/shared_columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,13 @@ Useful for identifying individual condominium buildings since the last 4
digits of a PIN identifies individual units
{% enddocs %}

## row_id

{% docs shared_column_row_id %}
Uniqe row identifier. Servese as a primary key if needed. Varies by table and
view.
{% enddocs %}

## tax_code

{% docs shared_column_tax_code %}
Expand Down

0 comments on commit 7a77761

Please sign in to comment.