Abstract model - aka Contracts - defined in a .yaml properties file, and a model configuration to tell dbt that it "implements" that abstract model/contract #6300
Replies: 2 comments 1 reply
-
@fabrice-etanchaud Yes! We've been hearing this more and more. Have you been following our conversation over in #6079? :) Copying some internal Slack messages I sent a few weeks ago:
My questions are all about the user stories / workflows here:
|
Beta Was this translation helpful? Give feedback.
-
There is a lot of buz around "Data Contracts". It seems to me that dbt has - as usual :-) - already the solution to that problem : A contract could be formalized with dbt as a yaml model properties file, containing not only the description of the model's attributes - name, type, null/not_null, accepted values - but also and more importantly the semantic rules, expressed as dbt tests. generic tests would formalize attribute, or group of attributes semantics singular tests would formalize row level semantics or model global computation rules (a kind of class invariant but for data sets) But there is something missing for now : the possibility to express singular tests on abstract models. What does dbt do with generic tests referencing unimplemented models ? I will give it a try. It would help to be able to list the singular tests modeling the model semantics inside the yaml file, to keep things together. What are your feelings ? |
Beta Was this translation helpful? Give feedback.
-
Hi all !
It's quite usual that business dbt models are first defined with business people before being implemented by analytics engineers.
It's would be great to have a way to define "abstract" models - or models "contracts", not related to a given sql or python implementation.
Then we could use a new configuration - maybe
config(implements=my_abstract_model)
? - to tell dbt that a given model implements a model contract.Would you find this helpful ?
We could use yaml anchors, but this wouldn't show up in downstream documentation or semantic layer.
Beta Was this translation helpful? Give feedback.
All reactions