Bug description
A histogram that rendered fine in 4.1.2 fails to render in 5.0.0rc3:
The issue is that there are NULL values in the x-axis variable. When I add a "Is Not Null" filter the chart renders in 5.0.0rc3.
Previously these were excluded automatically and the chart would render, which is a reasonable behavior.
I found this error message confusing as it looked like a SQL problem but the chart's underlying SQL did not change. And it's not so much "non-numeric values" as it is NULLs since this is a numeric column.
The logs:
2025-06-11 02:48:29,472:WARNING:superset.views.error_handling:Exception
Traceback (most recent call last):
File "/app/.venv/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request
rv = self.dispatch_request()
File "/app/.venv/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/app/.venv/lib/python3.10/site-packages/flask_appbuilder/security/decorators.py", line 101, in wraps
return f(self, *args, **kwargs)
File "/app/superset/views/base_api.py", line 120, in wraps
duration, response = time_function(f, self, *args, **kwargs)
File "/app/superset/utils/core.py", line 1369, in time_function
response = func(*args, **kwargs)
File "/app/superset/utils/log.py", line 304, in wrapper
value = f(*args, **kwargs)
File "/app/superset/charts/data/api.py", line 260, in data
return self._get_data_response(
File "/app/superset/utils/log.py", line 304, in wrapper
value = f(*args, **kwargs)
File "/app/superset/charts/data/api.py", line 423, in _get_data_response
result = command.run(force_cached=force_cached)
File "/app/superset/commands/chart/data/get_data_command.py", line 45, in run
payload = self._query_context.get_payload(
File "/app/superset/common/query_context.py", line 102, in get_payload
return self._processor.get_payload(cache_query_context, force_cached)
File "/app/superset/common/query_context_processor.py", line 752, in get_payload
query_results = [
File "/app/superset/common/query_context_processor.py", line 753, in <listcomp>
get_query_results(
File "/app/superset/common/query_actions.py", line 227, in get_query_results
return result_func(query_context, query_obj, force_cached)
File "/app/superset/common/query_actions.py", line 103, in _get_full
payload = query_context.get_df_payload(query_obj, force_cached=force_cached)
File "/app/superset/common/query_context.py", line 123, in get_df_payload
return self._processor.get_df_payload(
File "/app/superset/common/query_context_processor.py", line 162, in get_df_payload
query_result = self.get_query_result(query_obj)
File "/app/superset/common/query_context_processor.py", line 287, in get_query_result
df = query_object.exec_post_processing(df)
File "/app/superset/common/query_object.py", line 452, in exec_post_processing
df = getattr(pandas_postprocessing, operation)(df, **options)
File "/app/superset/utils/pandas_postprocessing/histogram.py", line 56, in histogram
raise ValueError(f"Column '{column}' contains non-numeric values")
ValueError: Column 'days_active' contains non-numeric values
2025-06-11 02:48:29,472:ERROR:superset.views.error_handling:Column 'days_active' contains non-numeric values
Traceback (most recent call last):
File "/app/.venv/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request
rv = self.dispatch_request()
File "/app/.venv/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/app/.venv/lib/python3.10/site-packages/flask_appbuilder/security/decorators.py", line 101, in wraps
return f(self, *args, **kwargs)
File "/app/superset/views/base_api.py", line 120, in wraps
duration, response = time_function(f, self, *args, **kwargs)
File "/app/superset/utils/core.py", line 1369, in time_function
response = func(*args, **kwargs)
File "/app/superset/utils/log.py", line 304, in wrapper
value = f(*args, **kwargs)
File "/app/superset/charts/data/api.py", line 260, in data
return self._get_data_response(
File "/app/superset/utils/log.py", line 304, in wrapper
value = f(*args, **kwargs)
File "/app/superset/charts/data/api.py", line 423, in _get_data_response
result = command.run(force_cached=force_cached)
File "/app/superset/commands/chart/data/get_data_command.py", line 45, in run
payload = self._query_context.get_payload(
File "/app/superset/common/query_context.py", line 102, in get_payload
return self._processor.get_payload(cache_query_context, force_cached)
File "/app/superset/common/query_context_processor.py", line 752, in get_payload
query_results = [
File "/app/superset/common/query_context_processor.py", line 753, in <listcomp>
get_query_results(
File "/app/superset/common/query_actions.py", line 227, in get_query_results
return result_func(query_context, query_obj, force_cached)
File "/app/superset/common/query_actions.py", line 103, in _get_full
payload = query_context.get_df_payload(query_obj, force_cached=force_cached)
File "/app/superset/common/query_context.py", line 123, in get_df_payload
return self._processor.get_df_payload(
File "/app/superset/common/query_context_processor.py", line 162, in get_df_payload
query_result = self.get_query_result(query_obj)
File "/app/superset/common/query_context_processor.py", line 287, in get_query_result
df = query_object.exec_post_processing(df)
File "/app/superset/common/query_object.py", line 452, in exec_post_processing
df = getattr(pandas_postprocessing, operation)(df, **options)
File "/app/superset/utils/pandas_postprocessing/histogram.py", line 56, in histogram
raise ValueError(f"Column '{column}' contains non-numeric values")
ValueError: Column 'days_active' contains non-numeric values
Screenshots/recordings
No response
Superset version
5.0.0rc3
Python version
3.9
Node version
16
Browser
Firefox
Additional context
No response
Checklist
- [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
This regression is due to stricter null handling in the backend histogram logic starting in 5.0.0rc3. The backend now converts the histogram column to numeric, and if any nulls (NaNs) remain, it raises a ValueError and blocks rendering—even if those nulls are just missing values in an otherwise numeric column. In previous versions, nulls were silently dropped and the chart rendered as expected. The frontend does not handle nulls; it expects already-cleaned data from the backend. There is currently no configuration or UI option to change this behavior—nulls are always dropped, and if any remain after conversion, the chart fails to render source.
As a workaround, you can add an "Is Not Null" filter to your chart, or preprocess your data to remove or fill nulls before rendering the histogram. If you want to see nulls handled differently (for example, binned as a separate category), the backend logic would need to be adjusted to allow this.
Let me know if you want more details on where this logic lives or how to patch it.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Comment From: rusackas
Would you consider this a 5.0.0 blocker? CC @michael-s-molina
Comment From: panrach
Hi! I was able to reproduce this: - went to a dataset and selected the histogram graph - added an "is not null" filter on a selected column
Were you able to resolve this issue or find a workaround?
Comment From: sfirke
This is still broken in 6.0.0rc2 but I'm using the workaround suggested by Dosu bot.
Try adding a filter for reply_count IS NOT NULL. In your example bot_id seems irrelevant, it's a matter of the column you're computing the histogram buckets on.
Following from my first screenshot, here is the filter that makes it work:
Comment From: panrach
You're right! Sorry about that, I misunderstood. I was able to recreate the issue and your workaround rendered the graph. Thank you!
Comment From: janani-gurram
Hi there!
My group and I are students in the Software Engineering (CSCD01) course at the University of Toronto. We'd like to be assigned to this issue and work on a fix that will render the histogram even if the x-axis variable contains NULL values.
Thanks!
@janani-gurram @panrach @zayleak @andre-fong @firozaAB
Comment From: sfirke
@janani-gurram go for it! This shouldn't be a hugely complex fix and it seems no one else is working on it
Comment From: panrach
Hi!
We are currently discussing a solution and wanted to ask what the expected behaviour of the histogram should be if all values in the x-axis variable are NULL. Ie. should it render an empty histogram or display the "no results were returned" message?
Thank you!
Comment From: sfirke
Let's do "no results returned", treating it like any other chart that is created from a dataset with zero rows.
On Sun, Oct 5, 2025, 6:05 PM Rachel Pan @.***> wrote:
panrach left a comment (apache/superset#33738) https://github.com/apache/superset/issues/33738#issuecomment-3369364511
Hi!
We are currently discussing a solution and wanted to ask what the expected behaviour of the histogram should be if all values in the x-axis variable are NULL. Ie. should it render an empty histogram or display the "no results were returned" message?
Thank you!
— Reply to this email directly, view it on GitHub https://github.com/apache/superset/issues/33738#issuecomment-3369364511, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZYDECS6K4VMIBEGR3DPH33WGI3XAVCNFSM6AAAAAB7BIRHYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGNRZGM3DINJRGE . You are receiving this because you authored the thread.Message ID: @.***>