Amihay Gonen
04/08/2023, 6:15 PMi need a query to get all tests in severity level warn which passed successful on the last 14 days from elementary tables
after a few pings pongs I got
SELECT distinct t.name AS test_name, r.detected_at AS test_date
FROM dbt_tests t
JOIN elementary_test_results r ON t.unique_id = r.test_unique_id
WHERE t.severity = 'warn'
AND r.status = 'pass'
AND r.detected_at >= DATEADD(day, -14, GETDATE());
this can be useful to find tests that candidate to increase the severity level based on data.
@Maayan Salom , this could be nice addition to in the SASS as insights/recommendation on dbt tests