You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
I'm not sure if this belongs in here or the spark or the databricks adapator, but a double type column in databricks returns false for all of is_float, is_numeric, and is_number.
Expected Behavior
It would return true for all those class method.
Steps To Reproduce
Create a databricks table with a double column
Use adapter.get_columns_in_relation(your_table) and loop over the columns, logging or adding comments for the .data_type and the .is_number()
Observe the column with type double has false for is_number()
Relevant log output
No response
Environment
- OS:
- Python:
- dbt: 1.4.1
Which database adapter are you using with dbt?
other (mention it in "Additional Context")
Additional Context
Using databricks as unable to test on spark, it is a delta table if that is relevant.
I believe it just needs to be added to the list here:
github-actionsbot
changed the title
[Bug] Missing type (double) in is_float for databricks
[CT-2043] [Bug] Missing type (double) in is_float for databricks
Feb 6, 2023
While both dbt-spark and dbt-databricks implement their own Column class (SparkColumn and DatabricksColumn), it doesn't look like either reimplements the is_float method. So, they're just using the BaseAdapter.Column method, defined in dbt-core, which you linked above.
Given that we already have double precision in the list above, and other data platforms (e.g. Snowflake) also treat DOUBLE and DOUBLE PRECISION as true aliases, it seems reasonable to me that we'd add double to the default is_float method.
Is this a new bug in dbt-core?
Current Behavior
I'm not sure if this belongs in here or the spark or the databricks adapator, but a
double
type column in databricks returns false for all ofis_float
,is_numeric
, andis_number
.Expected Behavior
It would return true for all those class method.
Steps To Reproduce
adapter.get_columns_in_relation(your_table)
and loop over the columns, logging or adding comments for the.data_type
and the.is_number()
double
hasfalse
foris_number()
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
other (mention it in "Additional Context")
Additional Context
Using databricks as unable to test on spark, it is a delta table if that is relevant.
I believe it just needs to be added to the list here:
dbt-core/core/dbt/adapters/base/column.py
Lines 55 to 63 in b2ea2b8
The text was updated successfully, but these errors were encountered: