getredash / redash

Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data.
http://redash.io/
BSD 2-Clause "Simplified" License
26.24k stars 4.36k forks source link

Passing all zeroes to the funnel visualization crashes the renderer #4529

Closed susodapop closed 4 years ago

susodapop commented 4 years ago

Issue Summary

If all stages of a funnel chart return zero, the funnel chart crashes and takes the renderer with it. Adding this visualization to a dashboard makes the entire dashboard crash on load.

Steps to Reproduce

  1. In postgres use the following SQL:
SELECT * FROM (VALUES 
('foo', 0),
('bar', 0),
('baz', 0),
('foobar', 0)) data(stage,value)

It produces the following table:

stage value
foo 0
bar 0
baz 0
foobar 0
  1. Add a funnel visualization with the the stage and value columns.
  2. Observe the chart does not render.
  3. Save the visualization and try clicking the Edit Visualization button. It won't work.

This is probably a divide-by-zero error.

Technical details:

srs231198 commented 4 years ago

A simple check before any calculations should solve the issue... Do you still require assistance with this?

susodapop commented 4 years ago

Thanks @srs231198. This has been solved already in the migration to React. Specifically this is fixed in https://github.com/getredash/redash/pull/4267