-
Notifications
You must be signed in to change notification settings - Fork 5
Update pinval.model_run with 2026 model runs
#985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
191f34a
bb1be22
010ba81
9e2c8a5
297ebee
56d9acb
44a4274
21c489d
62ec4df
be3f375
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,17 +11,20 @@ def model(dbt, session): | |
| on_schema_change="append_new_columns", | ||
| ) | ||
|
|
||
| # Build the base metadata DataFrame | ||
| base_query = """ | ||
| SELECT | ||
| run_id, | ||
| year, | ||
| assessment_year, | ||
| dvc_md5_training_data | ||
| FROM model.metadata | ||
| WHERE run_type = 'final' | ||
| """ | ||
| metadata_df = session.sql(base_query) | ||
| # Get model metadata for every final model. We do this by inner joining | ||
| # The `metadata` table to the `final_model` table instead of filtering | ||
| # the metadata table by `run_type == 'final'` to make it easier to run | ||
| # tests on this table, since we can control the contents of `final_model` | ||
| # via a dbt seed | ||
| metadata_df = ( | ||
| dbt.source("model", "metadata") | ||
| .join( | ||
| dbt.ref("model.final_model").select("run_id"), | ||
|
Comment on lines
+20
to
+22
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Switching to |
||
| on="run_id", | ||
| how="inner", | ||
| ) | ||
| .select("run_id", "year", "assessment_year", "dvc_md5_training_data") | ||
| ) | ||
|
|
||
| if dbt.is_incremental: | ||
| # anti-join out any run_ids already in the target | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -294,7 +294,7 @@ SELECT | |
| WHEN | ||
| pin_cd.class_code IS NULL -- Class is not in our class dict | ||
| OR NOT pin_cd.regression_class | ||
| OR (pin_cd.modeling_group NOT IN ('SF', 'MF')) | ||
| OR (pin_cd.modeling_group NOT IN ('SF', 'MF', 'BB')) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do include B&Bs in the training and assessment sets for the model, even though they usually get modeled by hand. That means that a B&B will wind up with |
||
| THEN 'non_regression_class' | ||
| WHEN LOWER(uni.triad_name) != LOWER(uni.assessment_triad) THEN 'non_tri' | ||
| WHEN ac.meta_card_num IS NULL THEN 'missing_card' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,7 +70,8 @@ training_data AS ( | |
| -- that have multiple final models. | ||
| WHERE train.run_id IN ( | ||
| '2024-03-17-stupefied-maya', | ||
| '2025-02-11-charming-eric' | ||
| '2025-02-11-charming-eric', | ||
| '2026-02-11-recursing-rob' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Thought, non-blocking]: I wonder if it would make sense to add another column in
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, I've been thinking about that too! I added a note to myself to discuss during our 2026 modeling retrospective. |
||
| ) | ||
| ), | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I came to realize this quirk of the model while testing a staging HomeVal deployment, so I figured I'd persist the change to make future HomeVal staging deployments easier.