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
It looks like dbt show --output json is incorrectly serializing integer values to scale-1 numeric (decimal) values. That is, JSON number instead of JSON integer.
-- models/my_model.sqlselect'0005'as stringnum, 'false'as stringbool, 10as intfield, false as boolfield, '01T00000aabbccdd'as dtstring
union allselect'0006'as stringnum, 'true'as stringbool, 20as intfield, true as boolfield, '01T00000aabbccde'as dtstring
github-actionsbot
changed the title
dbt show --output json converts integers to scale-1 numerics
[CT-2853] dbt show --output json converts integers to scale-1 numerics
Jul 20, 2023
This is quite the throwback :) #3499
It looks like
dbt show --output json
is incorrectly serializinginteger
values to scale-1 numeric (decimal) values. That is, JSONnumber
instead of JSONinteger
.What's going on?
We're just using the
agate
library's type system and JSON serialization:dbt-core/core/dbt/task/show.py
Lines 78 to 83 in eeb0570
This is being returned and saved as a
decimal.Decimal
type, rather than a Pythonint
.This is not a regression
It's always been a problem for the dbt Cloud IDE. Here's query in dbt-core v1.4 (+ dbt-rpc):
And using dbt-core v1.6.0-rc1:
But it would be nice to finally fix this, especially now that the power to do so is fully within our grasp :)
The text was updated successfully, but these errors were encountered: