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

[Feature Request] Test against empty string character / text columns #311

Open sgoley opened 1 week ago

sgoley commented 1 week ago

Description: Currently there is no easily available test to ensure that varchar columns do not contain empty strings.

Motivation: This is useful to test for in order to prevent downstream data type collisions (especially via coercion like in unions on snowflake Ex. https://community.snowflake.com/s/article/Numeric-value-is-not-recognized

Criteria: The test should only fail when encountering a varchar / text value equal to '' Also, the trim function should be able to be optionally applied based on an argument since it may not be required for all cases or supported by all database engines.