duckdb/dbt-duckdb

is_number() incorrectly false on some int subtypes

droher opened this issue · 2 comments

dbt's doc says that Column's is_number() should be true for any number type: https://docs.getdbt.com/reference/dbt-classes#column

But it looks like it's only recognizing certain types of duckdb integers. For example:

{{ col }}: {{ col.is_number() }}

yields

<Column event_key (UINTEGER)>: False
 <Column at_bats (TINYINT)>: False

<Column season (SMALLINT)>: True
<Column outs_recorded (INTEGER)>: True

@droher hey man, nice to hear from you (although I wish it were under happier circumstances!)

Looks like we need to subclass the dbt Column class in dbt-duckdb and fix this bit of it up: https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/adapters/base/column.py#L52

Thanks for the fix and nice to hear from you as well - I will have happier circumstances to report in a couple days when I release my baseball database that has been the impetus for all of the bug reports!