feat: add PROPERTY dbt models + fix parse_mixed_date ordering - #11
Open
benjamin-shi-tql wants to merge 7 commits into
Open
feat: add PROPERTY dbt models + fix parse_mixed_date ordering#11benjamin-shi-tql wants to merge 7 commits into
benjamin-shi-tql wants to merge 7 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Models the Yardi
RAW.PROPERTYobject into staging -> intermediate -> marts, following the same conventions as the existing transaction/unit models, and fixes a latent date-parsing bug in the sharedparse_mixed_datemacro.New models
models/staging/stg_yardi__properties.sql(+ yml)models/intermediate/int_yardi__property_details.sql(+ yml)models/marts/dim_properties.sql(+ yml)Data-quality remediations (validated against live Snowflake, n=20)
SZIPCODENUMBER ->LPAD(...,5,'0')(Boston 2101 -> '02101').ITYPE->property_type(Residential/Commercial/Mixed Use).DACQUIRED/DDISPOSED-> DATE via macro (100% parse coverage).BACTIVE/BTAXEXEMPT0/1 -> boolean.HOWNER->NULLIF(...,0).SREGIONdisagrees with property state for 14/20 rows (70%) (e.g. New York NY tagged "Southeast"). Conformedregionderived fromstate; raw kept asregion_reported+_int_region_mismatchflag.ITOTALUNITSkept authoritative; actualRAW.UNITcount surfaced as_int_unit_count_mismatch(observability only — UNIT is a partial sample)._int_active_disposed_conflictreconcilingBACTIVEvs disposal date.Macro bug fix (broader impact)
MM/DD/YYYYwas tried beforeMM/DD/YY; SnowflakeTRY_TO_DATEgreedily accepts a 2-digit year into the 4-digit slot, so01/21/08parsed to year 0008. This silently corrupted 426/2000TRANS.DTEFFECTIVEand 35/240UNIT.DTLASTINSPECTIONrows to years < 1900. ReorderingMM/DD/YYfirst fixes it (2-digit format returns NULL for genuine 4-digit years). Post-fix: 0 parse failures, 0 sub-1900 years across all four TEXT date columns. This also repairs the existingfct_transactionsanddim_unitsmodels.