Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Show full long number in text email report for table chart. #19575

Merged

Conversation

codemaster08240328
Copy link
Contributor

SUMMARY

Before this update, when we have long number in text email report for table chart, report was not showing correct value.

It was because pd converts long float value into e type.

In this pr, we added some display viz option into pd, so all long float value are displayed as a string.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE:
image

AFTER:
image

TESTING INSTRUCTIONS

  1. Create a virtual dataset using this sql:
select product_line, (sum(price_each)) * 12314 as Calculation
from "Vehicle Sales"
group by 1
  1. Create a table chart using Virtual Dataset.
  2. create a report sending this chart by email as text

Check the email.

ADDITIONAL INFORMATION

  • Bug fix

@@ -95,6 +98,9 @@ def get_chart_dataframe(
return None

result = simplejson.loads(content.decode("utf-8"))
pd.set_option(
"display.float_format", lambda x: str(x)
) # need to convert float value to string to show full long number
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the comment above the line:

# comm
pd.set_option...

superset/utils/csv.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Apr 8, 2022

Codecov Report

Merging #19575 (8edfcff) into master (5e468f7) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master   #19575   +/-   ##
=======================================
  Coverage   66.54%   66.54%           
=======================================
  Files        1692     1692           
  Lines       64775    64804   +29     
  Branches     6661     6661           
=======================================
+ Hits        43103    43125   +22     
- Misses      19972    19979    +7     
  Partials     1700     1700           
Flag Coverage Δ
hive 52.87% <0.00%> (+0.01%) ⬆️
mysql 81.90% <100.00%> (-0.01%) ⬇️
postgres 81.94% <100.00%> (-0.01%) ⬇️
presto 52.71% <0.00%> (+0.01%) ⬆️
python 82.37% <100.00%> (-0.01%) ⬇️
sqlite 81.71% <100.00%> (-0.01%) ⬇️
unit 47.95% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/utils/csv.py 97.67% <100.00%> (+0.05%) ⬆️
superset/views/base.py 73.77% <0.00%> (-0.74%) ⬇️
superset/db_engine_specs/presto.py 88.70% <0.00%> (-0.33%) ⬇️
superset/dashboards/filters.py 93.67% <0.00%> (ø)
superset/db_engine_specs/gsheets.py 75.51% <0.00%> (ø)
superset/views/base_api.py 98.38% <0.00%> (+0.06%) ⬆️
superset/models/sql_types/presto_sql_types.py 80.39% <0.00%> (+0.90%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e468f7...8edfcff. Read the comment docs.

@rusackas
Copy link
Member

Approving (and re-starting CI... sigh). Heads up to @eschutho in case you have any additional feelings here.

Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@rusackas rusackas merged commit 4dc1934 into apache:master Apr 22, 2022
hughhhh pushed a commit to hve-labs/superset that referenced this pull request May 11, 2022
…che#19575)

* fix lint issue

* resolve comment

* fix pipeline broken issue

* resolve pipeline broken issue
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
…che#19575)

* fix lint issue

* resolve comment

* fix pipeline broken issue

* resolve pipeline broken issue
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels Preset-Patch size/XS 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants