GitHub user dosubot[bot] added a comment to the discussion: How to casting float to double in Superset 5.0.0?
<!-- Answer --> Superset’s histogram chart only accepts columns recognized as “numeric” (GenericDataType.Numeric) by its internal type mapping. Both float and double should be mapped as numeric, but if your column isn’t accepted, it’s likely because the database returns a type string that Superset doesn’t recognize as numeric, especially after casting or using expressions. Try these steps: 1. In SQL Lab, cast your column to a standard numeric type like BIGINT or DECIMAL (e.g., `CAST(column_name AS BIGINT)` or `CAST(column_name AS DECIMAL)`), then check if Superset recognizes it as numeric in the dataset editor or chart controls. Casting to BIGINT is a known workaround for type recognition and rendering issues in Superset charts, including histograms [[source]](https://github.com/apache/superset/issues/33556#issuecomment-2900100640). 2. Make sure your data has no nulls in the column you want to use, as Superset 5.0.0 enforces strict null handling for histograms—nulls must be filtered or filled before charting [[source]](https://github.com/apache/superset/issues/33738#issuecomment-2961105288). 3. If the column still isn’t recognized, check the column’s type in SQL Lab’s results. If it’s not a standard numeric type, try a different cast or adjust your SQL expression. If you let me know which database backend you’re using (e.g., PostgreSQL, MySQL), I can give more specific guidance. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/ff0bd1cf-185a-4935-8f4a-d4c813e58e5e?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/ff0bd1cf-185a-4935-8f4a-d4c813e58e5e?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/ff0bd1cf-185a-4935-8f4a-d4c813e58e5e?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/ff0bd1cf-185a-4935-8f4a-d4c813e58e5e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ff0bd1cf-185a-4935-8f4a-d4c813e58e5e?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/ff0bd1cf-185a-4935-8f4a-d4c813e58e5e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ff0bd1cf-185a-4935-8f4a-d4c813e58e5e?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)& nbsp;[](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/34717) GitHub link: https://github.com/apache/superset/discussions/34717#discussioncomment-14114098 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
