flexanalytics / dbt_observability

Apache License 2.0
1 stars 0 forks source link

Feature: db-agnostic way to unnest json column for test_metadata #4

Open MiConnell opened 6 months ago

MiConnell commented 6 months ago

currently the test_metadata column looks something like the below

{
    "name": "accepted_values",
    "kwargs": {
        "values": [
            "Cancelled",
            "Delivered",
            "Shipped"
        ],
        "column_name": "status",
        "model": "{{ get_where_subquery(ref('dim_order')) }}"
    },
    "namespace": null
}

or

{
    "name": "not_null",
    "kwargs": {
        "column_name": "customer_key",
        "model": "{{ get_where_subquery(ref('fact_sales')) }}"
    },
    "namespace": null
}

and it would be very useful to dynamically unnest those values out into columns. This would have to be universal.