soda-core
soda-core copied to clipboard
Retrieve sample for FAIL checks
Description
Probably extends what was mentioned in https://github.com/sodadata/soda-core/issues/1497 but it would be nice to be able to define a sample set to be returned.
Example
If the check is:
product_stock >= 50:
product_stock query: |
SELECT unitsinstock + unitsonorder
FROM products
We will se something like:
[product_stock >= 50] FAIL (check_value: 39.0)
Knowing SODA under the hood already manages the query:
SELECT unitsinstock + unitsonorder
FROM products
Would be ideal to ask for samples to be returned using derived query:
SELECT *
FROM products
WHERE NOT unitsinstock + unitsonorder >= 50
LIMIT 10
NOTE: Added a limit to be defined somewhere 😄
SODA-975
Hi @IraitzM,
Soda supports this through "failed row checks": https://docs.soda.io/soda-cl/failed-rows-checks.html. Can you validate this answers your question?
Thanks @mathissedestrooper! Yes, I was aware of that... But I did not check if returns a query when asking from a notebook. Will check.
My question was more related to getting the query so that it could be used while using Soda-Core (as a way to check while you are developing your tests, more interactivelly). But sure, it would be similar to the failed-rows-checks in Soda-Cloud.