calogica / dbt-expectations

Port(ish) of Great Expectations to dbt test macros
https://calogica.github.io/dbt-expectations/
Apache License 2.0
989 stars 120 forks source link

[BUG] Table columns names that contain spaces trigger runtime errors. #302

Open pulsation opened 4 months ago

pulsation commented 4 months ago

Is this a new bug in dbt-expectations?

Current Behavior

Table columns names that contain spaces trigger runtime errors such as : Parser Error: syntax error at or near "Index".

Expected Behavior

While it's weird to have table columns containing spaces, they should not trigger errors. Enclosing table column names with "s may fix this.

Steps To Reproduce

Add a dbt_expectations.expect_column_values_to_not_be_in_set on a column that contains one or more spaces.

Relevant log output

18:15:16 Runtime Error in test dbt_expectations_expect_column_values_to_not_be_in_set_volumes_2008_Price_IndexERRNA__blank_ (models/schema.yml) Parser Error: syntax error at or near "Index"

Environment

- OS: MacOS 12.7.3
- Python: 3.12.2
- dbt: 1.7.9
- dbt-expectations: 0.10.3

Which database adapter are you using with dbt?

DuckDB, but Postgres also has this problem.