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(pandas-postprocessing): percentage compare to use correct column #16716

Merged
merged 1 commit into from
Sep 16, 2021

Conversation

villebro
Copy link
Member

@villebro villebro commented Sep 16, 2021

SUMMARY

Currently the percentage compare post processing operation is using the following formula

change = (new - old) / new

while the correct formula should most likely be

change = (new - old) / old

Example:

increase from 500 to 1000 (expected result is it should have doubled):

old:

change = (1000 - 500) / 1000 = 50 %

new:

change = (1000 - 500) / 500 = 100 %

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

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

LGTM

@villebro villebro added the v1.3 label Sep 16, 2021
@codecov
Copy link

codecov bot commented Sep 16, 2021

Codecov Report

Merging #16716 (a7523ac) into master (092ef5b) will decrease coverage by 0.12%.
The diff coverage is 80.00%.

❗ Current head a7523ac differs from pull request most recent head 5a31187. Consider uploading reports for the commit 5a31187 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16716      +/-   ##
==========================================
- Coverage   76.99%   76.86%   -0.13%     
==========================================
  Files        1007     1007              
  Lines       54133    54141       +8     
  Branches     7374     7374              
==========================================
- Hits        41678    41616      -62     
- Misses      12215    12285      +70     
  Partials      240      240              
Flag Coverage Δ
hive ?
mysql 81.75% <80.00%> (+0.04%) ⬆️
postgres 81.81% <80.00%> (+<0.01%) ⬆️
presto 81.62% <80.00%> (-0.04%) ⬇️
python 82.08% <80.00%> (-0.25%) ⬇️
sqlite 81.38% <80.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
superset/utils/pandas_postprocessing.py 84.09% <ø> (ø)
superset/db_engine_specs/bigquery.py 86.84% <66.66%> (-0.92%) ⬇️
superset/models/core.py 89.82% <100.00%> (+0.07%) ⬆️
superset/db_engines/hive.py 0.00% <0.00%> (-82.15%) ⬇️
superset/db_engine_specs/hive.py 69.80% <0.00%> (-16.87%) ⬇️
superset/connectors/sqla/models.py 89.46% <0.00%> (-0.24%) ⬇️
superset/utils/core.py 89.76% <0.00%> (-0.13%) ⬇️
superset/db_engine_specs/base.py 88.58% <0.00%> (+0.19%) ⬆️

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 092ef5b...5a31187. Read the comment docs.

@villebro villebro merged commit a839649 into apache:master Sep 16, 2021
@villebro villebro deleted the villebro/postproc-compare branch September 16, 2021 10:30
villebro added a commit that referenced this pull request Sep 22, 2021
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
@mistercrunch mistercrunch added 🍒 1.3.1 🍒 1.3.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.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-io size/XS v1.3 🍒 1.3.1 🍒 1.3.2 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants