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
print_profile_schema already generates a schema.yml skeleton with profile metrics stored in meta. It could go further and emit dbt test suggestions based on what the profile reveals — turning a profile run into a data contract bootstrap tool.
Overview
print_profile_schemaalready generates aschema.ymlskeleton with profile metrics stored inmeta. It could go further and emit dbt test suggestions based on what the profile reveals — turning a profile run into a data contract bootstrap tool.Motivation
Today
print_profile_schemaoutputs:A user then has to manually translate this into tests. The mapping is mechanical and well-defined, so the macro can do it automatically.
Suggested rules
is_unique = true- uniquenot_null_proportion = 1.0- not_nulldistinct_count <= N(configurable, e.g. 20)- accepted_values: values: [...]populated from the actual values (requires value frequency feature)minandmaxpresent- dbt_utils.expression_is_true: expression: "col between {min} and {max}"API design
New optional parameter on
print_profile_schema:Notes
accepted_valuessuggestion depends on the value frequency feature (Question: add TOP x column values and distribution. #65 / a future issue) to know the actual distinct values