Open insuhpak opened 3 weeks ago
I like the options Insuh. I do like handling setid
at the source CTE (feels appropriate there), but I also like the final_where_condition
tag being able to handle other conditions.
Is the reason the ucsc_setid
meta tag wouldn't work in the general feature approach due to the fact that setid
doesn't exist in other projects (besides Student)? If it doesn't exist couldn't we just not populate it and then the macro wouldn't take it into consideration?
Let's bring this up at the next AE meeting. I'm interested in what the others have to say.
Ideally I would like to avoid making a new macro specifically for setid'd UCPath tables.
(A general feature approach)
A feature could be added such that a where condition or conditions could be declared in the source.yml for each table and then surfaced in the generated model.
The declared
final_where_condition
would surface in the final select statement of the staging model. For example,(A UCPath setid specific approach)
If we choose to make a setid specific UCPath macro, then the meta information declared can be more specific (naming wise).
We could also have more freedom in where the condition is set. For example we can apply the condition at the source CTE,
The reason
final_where_condition
is restricted to the final select statement is so devs have more freedom in what kind of conditions they can specify. Since it is going to be added to the final select statement then can apply conditions on fields that were added during the staging process.I prefer the
final_where_condition
method because this can be used in other models and not just for UCPath setid tables.For example for our effseq'd models we could
final_where_condition = ["setid in ('UCHSR ')", "is_max_effseq_of_effdt = true"]
.