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: time comparison can't guarantee the accuracy #16895

Merged
merged 7 commits into from
Sep 30, 2021

Conversation

zhaoyongjie
Copy link
Member

@zhaoyongjie zhaoyongjie commented Sep 29, 2021

SUMMARY

The time comparison in AA can't guarantee accuracy when applied to multiple series line charts.

Due to the errors of the original algorithm, only consider using the time column to join. Now the join algorithm is improved.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

After

Time comparison-after

Before

Time comparison-before

Time.comparison-before.mov

TESTING INSTRUCTIONS

  1. select birth_names dataset
  2. switch to time-series chart
  3. set time grain to year
  4. set time range to 1970 - 2000
  5. set metrics to sum__num
  6. set group by to state
  7. set series limit to 2 for convenience
  8. set time shift to 3 years later
  9. set calculation type to actual values
  10. use the south panel to observe the accuracy of the data

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

@codecov
Copy link

codecov bot commented Sep 30, 2021

Codecov Report

Merging #16895 (8e12718) into master (3d8cc15) will decrease coverage by 0.11%.
The diff coverage is 84.15%.

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

@@            Coverage Diff             @@
##           master   #16895      +/-   ##
==========================================
- Coverage   77.02%   76.90%   -0.12%     
==========================================
  Files        1021     1021              
  Lines       54754    54849      +95     
  Branches     7470     7481      +11     
==========================================
+ Hits        42173    42183      +10     
- Misses      12335    12419      +84     
- Partials      246      247       +1     
Flag Coverage Δ
hive ?
mysql 81.85% <89.04%> (+<0.01%) ⬆️
postgres 81.91% <89.11%> (+<0.01%) ⬆️
presto 81.79% <88.43%> (+<0.01%) ⬆️
python 82.17% <89.11%> (-0.24%) ⬇️
sqlite 81.52% <88.35%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
superset-frontend/src/views/CRUD/hooks.ts 47.23% <ø> (ø)
superset/datasets/commands/update.py 94.11% <ø> (ø)
superset/datasets/dao.py 96.50% <ø> (-0.12%) ⬇️
...erset-frontend/src/SqlLab/components/ResultSet.tsx 61.94% <20.00%> (-1.42%) ⬇️
...eFilters/FiltersConfigModal/FiltersConfigModal.tsx 89.42% <64.28%> (-2.80%) ⬇️
...mponents/nativeFilters/FiltersConfigModal/utils.ts 72.22% <66.66%> (ø)
superset/utils/sqllab_execution_context.py 90.55% <66.66%> (-1.83%) ⬇️
superset/sqllab/exceptions.py 80.95% <80.95%> (ø)
superset/sqllab/command.py 82.98% <88.63%> (+0.54%) ⬆️
...onfigModal/FiltersConfigForm/FiltersConfigForm.tsx 73.83% <92.85%> (-0.05%) ⬇️
... and 12 more

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 3d8cc15...fc5b43f. Read the comment docs.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Sep 30, 2021
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM and tested to work as expected. Thanks for fixing this and adding comprehensive tests!

@zhaoyongjie zhaoyongjie merged commit 94282b7 into apache:master Sep 30, 2021
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
* fix: time comparison can't guarantee the accuracy

* fix multiple series

* fix lint

* fix ut

* fix lint

* more ut

* fix typo
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
* fix: time comparison can't guarantee the accuracy

* fix multiple series

* fix lint

* fix ut

* fix lint

* more ut

* fix typo
@mistercrunch mistercrunch added 🏷️ 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 size/L 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants