Given some databases we support in the future do support try_cast (for example, snowflake) we will end up with different behaviors when using different databases.
I might be missing something, but I think if there is a failed cast we would want it to properly raise an error and then debug this properly, rather than creating NULLs ?
Having thought about it - maybe we should just use vanilla ANSI stye casting instead of the cast/try_cast macro, although these may handle some specific type instances I am unaware of!
dbt.safe_cast
is used across 17 files - however, neither thepostgres
adapter norduckdb
support safe cast (although interestingly duckdb does support it), and so all this macro will do is use the usual ANSI style casting like so.Given some databases we support in the future do support try_cast (for example, snowflake) we will end up with different behaviors when using different databases.
I might be missing something, but I think if there is a failed cast we would want it to properly raise an error and then debug this properly, rather than creating
NULL
s ?Extends #40