[Feature] Allow adapters to override unspecified values in unit tests #10447
Labels
enhancement
New feature or request
triage
unit tests
Issues related to built-in dbt unit testing functionality
Is this your first time submitting a feature request?
Describe the feature
The current unit testing implementation fills in
null
s for unspecified values. This is however problematic for databases which have non-nullable datatypes, like Clickhouse, as a cast tonull
will always trigger an error.Therefore the adapter should be given the option to override the unspecified value depending on the datatype.
The lack of this feature currently blocks unit tests on Clickhouse adapter.
Describe alternatives you've considered
safe_cast()
macro could be an option. However, a safe cast is supposed to render values in doubt tonull
, which would not work well with non-nullable datatypes. Tampering with the macro just for the purpose of making it work for unit tests would interfere with other usages ofsafe_cast()
get_fixture_sql()
macro. But it's not really intended to be overwritten by an adapter and it would be hard to maintainWho will this benefit?
Any database that has not-nullable datatypes, like Clickhouse.
Are you interested in contributing this feature?
Sure.
Anything else?
Relates to this issue.
The text was updated successfully, but these errors were encountered: