sodadata / soda-sql

Soda SQL and Soda Spark have been deprecated and replaced by Soda Core. docs.soda.io/soda-core/overview.html
https://docs.soda.io/
Apache License 2.0
59 stars 16 forks source link

Test with chained condition valid, but evaluates only one #150

Open HansBambel opened 2 years ago

HansBambel commented 2 years ago

Describe the bug I was toying around with test conditions and had the following scan file working:

columns:
  my_column:
    tests:
      - avg > 2500
      - avg < 3100

The tests for these passed. I wanted to make the test a bit more readable by chaining the comparisons:

columns:
  my_column:
    tests:
      - 2500 < avg < 3100

The tests here passed as well, but when checking the output I see that this is the case because only the first part of the expression is tested: Test column(my_column) test(2500 < avg < 3100) passed with measurements {"expression_result": 2500, "avg": 2799.1337}

I was expecting either an error message that this kind of comparison is not valid/possible or the test should test for both conditions. The docs could also specify that this is not possible (if that is the case).

OS: MacOS Python Version: 3.7 Soda SQL Version: Warehouse Type: postgres