Repository navigation
Closed
Labels
#bug:regressionBugs that are identified as regessionsgood first issueGood first issues for new contributorsviz:charts:histogramRelated to the Histogram chart
Description
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.
- I have searched the GitHub issue tracker and didn't find a similar bug report.
- 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.
Metadata
Metadata
Assignees
Labels
#bug:regressionBugs that are identified as regessionsgood first issueGood first issues for new contributorsviz:charts:histogramRelated to the Histogram chart
Type
Projects
- StatusShow more project fieldsCherried
- StatusShow more project fieldsDone

Activity
[-]Histogram fails to load with null values in x-axis (regression from 4.1.2 -> 5.0.0rc3)[/-][+]Histogram fails to load when null values present in x-axis variable (regression from 4.1.2 -> 5.0.0rc3)[/+]dosubot commentedon Jun 11, 2025
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.
Share context across your team and agents. Try Dosu.
rusackas commentedon Jun 11, 2025
Would you consider this a 5.0.0 blocker? CC @michael-s-molina
panrach commentedon Oct 1, 2025
Hi! I was able to reproduce this:
Were you able to resolve this issue or find a workaround?
[-]Histogram fails to load when null values present in x-axis variable (regression from 4.1.2 -> 5.0.0rc3)[/-][+]Histogram fails to load when null values present in x-axis variable (regression from 4.1.2, occured in 5.0.0rc3, present in 6.0.0rc2)[/+]sfirke commentedon Oct 1, 2025
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 examplebot_idseems 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:
panrach commentedon Oct 2, 2025
You're right! Sorry about that, I misunderstood.
I was able to recreate the issue and your workaround rendered the graph. Thank you!
janani-gurram commentedon Oct 2, 2025
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
sfirke commentedon Oct 2, 2025
@janani-gurram go for it! This shouldn't be a hugely complex fix and it seems no one else is working on it
2 remaining items
panrach commentedon Oct 5, 2025
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!
sfirke commentedon Oct 5, 2025
janani-gurram commentedon Oct 9, 2025
We’re proposing the following fix to address this issue:
We also plan to add test cases to validate this behavior when the target column has all nulls (with and without grouping) and when the target column has some nulls (with and without grouping).
We’d appreciate any community feedback on this approach
sfirke commentedon Oct 9, 2025
Sounds good to me! I'm not sure you need to say the second bullet, I would think that "continue as usual" means return the empty DataFrame. But at any rate, please go ahead.
panrach commentedon Oct 14, 2025
Thank you for the feedback!
We also originally thought that the second bullet was unnecessary, but we caught a problem with this approach when writing unit tests.
If we exclude the second point and don't return early, there are 2 problems that happen:
unstackexpects a MultiIndex but the DataFrame is emptyWith that being said, if the DataFrame is empty after dropping empty values, is returning the empty DataFrame a reasonable approach?
sfirke commentedon Oct 15, 2025
Yep that sounds great! Thanks for the explanation, it sounds like you are taking a thorough approach.
fix(histogram): add NULL handling for histogram (apache#33738)
fix(histogram): add NULL handling for histogram (apache#33738)
janani-gurram commentedon Oct 17, 2025
Hi, we’ve submitted a PR with our proposed fix: #35693. Feedback is welcome!