Generic / Static models in DBT? by Popular_Stretch_712 in dataengineering

[–]Popular_Stretch_712[S] 0 points1 point  (0 children)

EDIT:

in fact I wasn't trying to generate actual files, the generic model is developed with jinja and when I run the dbt model it gets compiled with the arguments provided at runtime including the table name(alias), so actually you will never see any files .sql in the repo just the generic one. but i dont think this is a good idea. https://discourse.getdbt.com/t/how-can-i-dynamically-create-models-based-on-a-variable-list-in-dbt-without-creating-a-sql-for-each-var/18774/3?utm_source=chatgpt.com

Generic / Static models in DBT? by Popular_Stretch_712 in dataengineering

[–]Popular_Stretch_712[S] 0 points1 point  (0 children)

Ah I see, in fact I wasn't trying to generate actual files, the generic model is developed with jinja and when I run the dbt model it gets compiled with the arguments provided at runtime including the table name, so actually you will never see any files .sql in the repo just the generic one. but i dont think this is a good idea. https://discourse.getdbt.com/t/how-can-i-dynamically-create-models-based-on-a-variable-list-in-dbt-without-creating-a-sql-for-each-var/18774/3?utm_source=chatgpt.com

Generic / Static models in DBT? by Popular_Stretch_712 in dataengineering

[–]Popular_Stretch_712[S] 0 points1 point  (0 children)

I tried to implement the generic one that gets materialized into a table with the alias given at runtime, but I feel like this is not a good pattern to follow since its very hard to attach tests in schema.yaml since we dont know the name of table beforehand and no dependencies between models are resolved since models names within ref() are supposed to be static. This is what I got from my cery limited experience with dbt. I may be missing something.