Hi, We are using DBT 1.2.0 with Redshift.
Based on tests | dbt Developer Hub
My understanding is that the “accepted_values” should support boolean type, as quoted
accepted_values
This test validates that all of the values in a column are present in a supplied list of values. If any values other than those provided in the list are present, then the test will fail.
The accepted_values test supports an optional quote parameter which, by default, will single-quote the list of accepted values in the test query. To test non-strings (like integers or boolean values) explicitly set the quote config to false.
But neither of the following YAML file formats works for us
tests:
- accepted_values:
values: [true, false]
quote: false
Or
tests:
- accepted_values:
values: ['true', 'false']
quote: false
And I got the following errors in the log:
*[2022-12-13, 20:17:34 UTC] {{subprocess.py:89}} INFO - [0m20:17:34 [33mDatabase Error in test accepted_values_dp_dim_clients_is_g_cfg_pm_checkin_enabled__False__true__false (models/marts/base/dim/dp_dim_clients.yml)[0m*
*[2022-12-13, 20:17:34 UTC] {{subprocess.py:89}} INFO - [0m20:17:34 operator does not exist: character varying <> boolean*
*[2022-12-13, 20:17:34 UTC] {{subprocess.py:89}} INFO - [0m20:17:34 HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts.*
*[2022-12-13, 20:17:34 UTC] {{subprocess.py:89}} INFO - [0m20:17:34 compiled SQL at target/run/data_platform_models/models/marts/base/dim/dp_dim_clients.yml/accepted_values_dp_dim_clients_8aca7694846b065184b5b74c9dfc691c.sql*
- Is the boolean type supported?
- If so, what is the syntax?
Thanks