Use new CubeJS "castNumeric" option
The latest version of CubeJS includes a new castNumeric
option.
This makes the client library always cast numeric values to actual JavaScript numbers.
Based on discussion we think it would be good to turn this option on.
Implementation plan
Something like this ought to do the trick.
--- a/ee/app/assets/javascripts/analytics/analytics_dashboards/data_sources/cube_analytics.js
+++ b/ee/app/assets/javascripts/analytics/analytics_dashboards/data_sources/cube_analytics.js
@@ -125,7 +125,7 @@ export const fetch = async ({
filters = {},
}) => {
const userQuery = buildCubeQuery(query, queryOverrides, filters);
- const resultSet = await createCubeJsApi(projectId).load(userQuery);
+ const resultSet = await createCubeJsApi(projectId).load(userQuery, { castNumerics: true });
return VISUALIZATION_PARSERS[visualizationType](resultSet, userQuery, visualizationOptions);
};