You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Include a corresponding [model name].yml properties file for all models.
These can be generated by running dbt run-operation generate_model_yaml --args '{"model_names": ["MODEL NAME"]}'
and saving the console output to a YAML file.
models:
- name: [model name]
config:
contract:
enforced: false # required while creating a contracted model, delete before merging
columns: # required for contracted models
- name: ...
data_type: ...
data_tests: # column tests, optional
- ...
data_tests: # model tests, optional
- ...
- dbt_utils.unique_combination_of_columns: # recommended for intermediate models
arguments:
combination_of_columns:
- ...
config:
store_failures: true
Include (or update) an exposure for all
models that will be consumed by a dashboard, analysis, or application:
This PR promotes the Overgrad URM graduation rate (og_urm) from a temporary field to an official column in two models: stg_kippadb__enrollment and base_kippadb__application. The approach looks reasonable overall, but there are two issues to address before merging.
Issues
🔴 Bug: Wrong join key in stg_kippadb__enrollment.sql
File: src/dbt/kipptaf/models/kippadb/staging/stg_kippadb__enrollment.sql, line 71
-- Current (likely wrong):one.id=n.account_id-- Should probably be:one.school__c=n.account_id
e.id is the Salesforce enrollment record ID, but n.account_id in the NSC crosswalk is a Salesforce Account ID (i.e., the college/school). These will never match, so og_urm will always be NULL in stg_kippadb__enrollment.
Compare with how base_kippadb__application.sql joins the same crosswalk on line 118: acc.id = n.account_id — where acc is stg_kippadb__account (the college). The enrollment model has e.school__c as school (line 53) which is the account ID you want.
The YAML adds a column named overgrad_urm_grad_rate, but the SQL does not output a column with that name. The SQL (lines 82–87) adds two new columns: og_urm and og_urm_preferred. Both are missing from the YAML, and overgrad_urm_grad_rate should be removed.
# Current (wrong):
- name: overgrad_urm_grad_ratedata_type: string# Should be:
- name: og_urmdata_type: string
- name: og_urm_preferreddata_type: numeric
Note: og_urm_preferred uses coalesce(cast(... as numeric), acc.adjusted_6_year_minority_graduation_rate) — its type should be numeric, not string. The stg_kippadb__enrollment.yml correctly documents og_urm as string.
Redundant og_urm in enrollment: Since base_kippadb__application.sql already joins the NSC crosswalk directly (on acc.id), the og_urm column in stg_kippadb__enrollment is not consumed by that model. It may be useful independently, but worth confirming there's a downstream consumer of enr.og_urm specifically.
select * in enr_clean passthrough (select ec.* ... on line 77) means the new og_urm column from enrollment is automatically promoted — no explicit column declaration needed there, which is fine for a staging-to-base passthrough.
The alias cleanup (adding e. prefix to all columns in enr_clean) is a clean improvement that makes the join unambiguous.
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
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.
Pull Request
Summary & Motivation
Self-review
General
TEAMster Asana Project
dbt
Include a corresponding
[model name].ymlproperties file for all models.These can be generated by running
dbt run-operation generate_model_yaml --args '{"model_names": ["MODEL NAME"]}'and saving the console output to a YAML file.
Include (or update) an
exposure for all
models that will be consumed by a dashboard, analysis, or application:
Dagster "kinds" Reference
SQL
Use the
union_dataset_join_clause()macro for queries that employ modelsthat use regional datasets
Do not use
group bywithout any aggregations when you mean to usedistinctAll
distinctusage must be accompanied by an comment explaining it'snecessity
Do not use
order byforselectstatements. That should be done in thereporting layer.
If you are adding a new external source, before building, run:
Troubleshooting