-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cast all numerical values as strings #1879
Comments
Hey cube team, I'm facing this problem currently! On the front end, Db: Postgres 11.8 @cubejs-backend/postgres-driver": "^0.26.10 @cubejs-client/core": "^0.26.0 |
+1 on this. I actually assume it's numbers and add them together downstream of cube -- Imagine my surprise when I saw a "number" like "12.5530566.1943.11.753.29" |
i found that cubejs cast NULL timestamp to 1970-01-01T00:00:00.000 when using rollup. |
haha, just ran into this and yeah if I want to use preAgg the measures are converted to a string and it breaks all of our charts since calculations need to be done. Only way around it is to parse everything to a number in the UI. |
We just had the opposite here whereby if we query a cube and a preaggregation is hit, the numbers are numbers but if it hits Athena instead of a preaggregation it comes back as a string. |
Just ran into this where a measure is a number when it results from a direct query and a string when it is calculated from a pre-aggregation. I guess the solution for now is to apply "parseInt" in our UI to every number returned by Cube. |
+1 |
Hi @shawno and everyone — Sorry this wasn't mentioned in this issue but we've released a relevant feature some time ago. So, now there's the I hope it helps. |
Is your feature request related to a problem? Please describe.
Cube.js can somewhat inconsistently cast numerical values as strings. This behaviour necessitates validation/conversion code on the client-side.
Describe the solution you'd like
The Cube.js API should cast all numerical values as strings (since JSON does not support
BigInt
) and the Cube.js Client should convert values back toNumber
/BigInt
Related issues
#1849
#1835
#349
The text was updated successfully, but these errors were encountered: