soda-core icon indicating copy to clipboard operation
soda-core copied to clipboard

Retrieve sample for FAIL checks

Open IraitzM opened this issue 2 years ago • 3 comments

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 😄

IraitzM avatar Jul 13 '22 08:07 IraitzM

SODA-975

jmarien avatar Jul 13 '22 08:07 jmarien

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?

mathissedestrooper avatar Aug 03 '22 07:08 mathissedestrooper

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.

IraitzM avatar Aug 03 '22 07:08 IraitzM