ccao-data / data-architecture

Codebase for CCAO data infrastructure construction and management
https://ccao-data.github.io/data-architecture/
5 stars 3 forks source link

Overwrite parking space indicators if they disagree with provided condo characteristics #332

Closed wrridgeway closed 4 months ago

wrridgeway commented 4 months ago

During condo characteristics collection some units were marked as parking spaces even though they have values for fields like beds/baths. We need to let these columns supersede parking space indicators if the indicator is clearly wrong.

wrridgeway commented 4 months ago
select
    pin,
    year,
    char_unit_sf,
    char_bedrooms,
    char_half_baths,
    char_full_baths,
    is_parking_space,
    parking_space_flag_reason
from default.vw_pin_condo_char
where pin10 IN ('1431209042', '1431208066')
    and year = '2023'

Previously:

pin year char_unit_sf char_bedrooms char_half_baths char_full_baths is_parking_space parking_space_flag_reason
14312080661001 2023         TRUE identified by valuations as non-unit
14312080661002 2023 1400 2   2 TRUE identified by valuations as non-unit
14312080661003 2023 1400 2   2 TRUE identified by valuations as non-unit
14312080661004 2023 1450 2   2 TRUE identified by valuations as non-unit
14312090421001 2023 700 1   1 TRUE identified by valuations as non-unit
14312090421002 2023 700 1   1 TRUE identified by valuations as non-unit
14312090421003 2023 1200 2   2 TRUE identified by valuations as non-unit
14312090421004 2023 850 2   1 TRUE identified by valuations as non-unit
14312090421005 2023   2   1 TRUE identified by valuations as non-unit
14312090421006 2023   2   2 TRUE identified by valuations as non-unit
14312090421007 2023 700 1   1 TRUE identified by valuations as non-unit
14312090421008 2023 700 1   1 TRUE identified by valuations as non-unit
14312090421009 2023         TRUE identified by valuations as non-unit
14312090421010 2023 700 1   1 TRUE identified by valuations as non-unit
14312090421011 2023 725 1   1 TRUE identified by valuations as non-unit
14312090421012 2023   2   2 TRUE identified by valuations as non-unit

Now:

pin year char_unit_sf char_bedrooms char_half_baths char_full_baths is_parking_space parking_space_flag_reason
14312080661001 2023         TRUE identified by valuations as non-unit
14312080661002 2023 1400 2   2 FALSE  
14312080661003 2023 1400 2   2 FALSE  
14312080661004 2023 1450 2   2 FALSE  
14312090421001 2023 700 1   1 FALSE  
14312090421002 2023 700 1   1 FALSE  
14312090421003 2023 1200 2   2 FALSE  
14312090421004 2023 850 2   1 FALSE  
14312090421005 2023   2   1 FALSE  
14312090421006 2023   2   2 FALSE  
14312090421007 2023 700 1   1 FALSE  
14312090421008 2023 700 1   1 FALSE  
14312090421009 2023         TRUE identified by valuations as non-unit
14312090421010 2023 700 1   1 TRUE cdu
14312090421011 2023 725 1   1 TRUE cdu
14312090421012 2023   2   2 TRUE cdu