feat: Yardi transaction pipeline (stg/int/fct)#1
Open
smorbad-byte wants to merge 1 commit into
Open
Conversation
Three-layer dbt transformation pipeline for RAW.TRANS: - stg_yardi__transactions: cleans types, renames columns, maps status codes, parses 5 date formats, drops 7 denormalized columns, adds QA flag - int_yardi__transaction_details: enriches via 7 dimension joins, adds derived business columns (days_to_post, net_amount, etc.) - fct_transactions: incremental merge fact table with surrogate key Also adds: - parse_mixed_date macro (reusable 5-format TRY_TO_DATE chain) - Source declarations with freshness checks for 9 RAW tables - Full test coverage (unique, not_null, accepted_values, relationships)
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.
Yardi Transaction Pipeline (stg / int / fct)
Three-layer dbt transformation pipeline for
RAW.TRANS, addressing all identified data quality issues.Pipeline Flow
Data Quality Issues Fixed
DTEFFECTIVE(TEXT)parse_mixed_datemacro with 5-formatTRY_TO_DATEchainISTATUS(0/1/2/3)posted/pending/reversed/archivedBVOID(0/1)is_voidedSCHECKNO,SGLACCTCODEHVENDOR = 0NULLIF(HVENDOR, 0)SPROPNAME,STENANTNAME, etc.DTEFFECTIVE_stg_effective_date_parse_failedobservability flagFiles Changed
New files (4):
macros/parse_mixed_date.sql— Reusable 5-format date parser macromodels/staging/stg_yardi__transactions.sql— Staging modelmodels/intermediate/int_yardi__transaction_details.sql— Intermediate model (7 dimension joins + derived columns)models/marts/fct_transactions.sql— Fact table (incremental merge, surrogate key)Updated files (4):
models/staging/_sources.yml— Populated with 9 RAW table declarations + freshness checksmodels/staging/_schema.yml— Tests & docs for staging modelmodels/intermediate/_schema.yml— Tests & docs for intermediate modelmodels/marts/_schema.yml— Tests & docs for mart modelDesign Decisions
is_voided = trueso audit trails are preserved; consumers filter as neededtransaction_idusingcreated_atas watermark; handles both new inserts and late-arriving updates (e.g., voided after initial load)fct_transactionsincludes denormalized dimension attributes for direct BI consumption, plus FK columns for joining to separate dim tablesint_yardi__transaction_detailsis materialized as ephemeral since it's only consumed byfct_transactionsHow to Run