feat: dbt-managed Snowflake semantic view for prospect funnel#6
Open
benjamin-shi-tql wants to merge 3 commits into
Open
feat: dbt-managed Snowflake semantic view for prospect funnel#6benjamin-shi-tql wants to merge 3 commits into
benjamin-shi-tql wants to merge 3 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
Deploys the prospect funnel metrics as a native Snowflake SEMANTIC VIEW (
YARDI.MARTS.SEM_PROSPECT_FUNNEL), with the DDL controlled from this dbt repo. This is the Snowflake-native alternative to the MetricFlow YAML approach (PR #5) — the metrics become a real Snowflake object consumable by Cortex Analyst andSEMANTIC_VIEW(...)queries.Pattern: control model + post-hook macro
dbt has no native
SEMANTIC VIEWmaterialization, so:models/semantic_views/sem_prospect_funnel.sql— one-row anchor model thatref('fct_prospects')(forces build order) and carries apost_hook.macros/create_prospect_semantic_view.sql— holds theCREATE OR REPLACE SEMANTIC VIEWDDL; runs on everydbt run.models/semantic_views/_sem_prospect_funnel.yml— docs/tests.Semantic view contents
prospectsoverfct_prospects, PKprospect_id, synonyms.Validation (live
Yardi (Demo))CREATE SEMANTIC VIEWdocs.dbt run; metric math validated by reproducing every metric on source data: 150 prospects, 19 leased, tour_rate 0.613, application_rate 0.547, approval_rate 0.415, lead_to_lease_conversion 0.127, avg_days_to_apply 7.4, avg_days_to_movein 34.1, avg_desired_rent 2221.Consuming
Depends on
fct_prospects(PR #4). Supersedes the MetricFlow YAML in PR #5 if you prefer the Snowflake-native route.