apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
61.75k stars 13.49k forks source link

Superset 3.0.0 export to Excel is changing 0 to 0E-20 #25668

Open rscarborough1996 opened 11 months ago

rscarborough1996 commented 11 months ago

When exporting to Excel, zeroes that would result from certain calculations are changed to 0E-20 when exported

How to reproduce the bug

Create a calculated column similar to this:

dividend / NULLIF(divisor, 0)

When divisor is 0, the chart returns 0 for the calculation. When the chart is exported to Excel, the zeroes in that column are changed to 0E-20.

Expected results

0

Actual results

0E-20

rusackas commented 6 months ago

I believe it, but this doesn't seem to have ruffled many feathers. Would you be willing to investigate a fix?

rscarborough1996 commented 6 months ago

I may take a look if I get some time. In the mean time, I looked into this a little more and I wasn't quite right in my initial assessment.

I think this result is tied to the datatypes of the column. For instance, if you create a column with this custom sql: 0/1.0000000000000 It returns 0E-15.

Another thing which may need a fix, is that when I open the excel file in LibreOffice Calc, many of the numeric fields are prefixed with an apostrophe, which means they are being treated as a string.

rusackas commented 1 month ago

This might be at risk of being closed as stale if we don't get more people corroborating it, or any volunteers to look into a fix. That said, maybe @dosu-bot can shed some light on the subject.

dosubot[bot] commented 1 month ago

Hello, @rusackas! I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. Let me know how I can assist you!

To address the issue where exporting to Excel in Superset 3.0.0 changes zeroes to 0E-20 and numeric fields in LibreOffice Calc are prefixed with an apostrophe, you should upgrade to Superset 3.0.1. The changelog for version 3.0.1 includes a fix for the issue with datetime and timezone in Excel export, which likely addresses the problem you are experiencing [1].

Refer to the following entry in the changelog:

- [#25318](https://github.com/apache/superset/pull/25318) fix: datetime with timezone excel export (@betodealmeida)

Upgrading to Superset 3.0.1 should resolve the issue.

To continue talking to Dosu, mention @dosu.