[Bug] Unit tests - expected varchar values are being truncated as integers #11322
Labels
bug
Something isn't working
triage
unit tests
Issues related to built-in dbt unit testing functionality
Is this a new bug in dbt-core?
Current Behavior
I have the following unit test setup with csv mock data:
And when I run

dbt test --select test_type:unit
against Redshift, it fails with the following message:I know it's a tricky one, as the docs state that dbt takes the value you provide and attempts to cast it to the data type as inferred from the input and output models (see docs). In this case
basic_search_id
is a concatenation ofsession_id
(varchar) andcustom_timestamp_utc
(bigint) and In the model, I'm specifically castingcustom_timestamp_utc
to a varchar:Expected Behavior
I expected that dbt would cast the expected values for
basic_search_id
to strings as I surrounded them in double quotes, therefore showing the whole value and not treat it as an integer and truncated it.Steps To Reproduce
See above
Relevant log output
Environment
- dbt-core=1.9.0
Which database adapter are you using with dbt?
redshift
Additional Context
No response
The text was updated successfully, but these errors were encountered: