soda-core
soda-core copied to clipboard
Resolve variables for user-defined checks
I would like use variables on user-defined checks queries, but it doesn't work.
# ${variable_name} doesn't work on user-defined checks queries
variables:
TS_START: start date
TS_END: end date
checks for table:
- count_column > 0 :
count_column query: |
select
count(column)
from "table"
where created_at > '${TS_START}' and created_at < '${TS_END}'
resulting in
| cursor.execute(self.sql)
| psycopg2.errors.InvalidDatetimeFormat: invalid input syntax for type timestamp: "${TS_START}"
| LINE 4: where created_at > '${TS_START}' and created_at ...
SODA-1012
It would also be great if we can pass in variables to the standard checks as well like:
- row_count > ${row_count_threshold}:
I believe the release of Soda Core 3.0.7 with a fix for 1577 resolves this issue. (Though the comment you made, @albinkjellin, is different and not resolved.