superset icon indicating copy to clipboard operation
superset copied to clipboard

refactor(plugins): BigNumber Time Comparison with existing time_offset API

Open Antonio-RiveroMartnez opened this issue 11 months ago • 18 comments

SUMMARY

Previously we implemented the time comparison in BigNumber viz using some new custom properties in the queryObject to compute the offsets. We are moving away from that approach in order to be more consistent with the way Superset handles time comparison in other visualizations.

Some of the changes of this PR are:

  • Use existing time_offset APIs instead of the instant comparison ones
  • Create new shared section to include the controls for time comparison, some taken from Advanced Analytics
  • Create a new control label to display the comparison ranges using existing time_range API and not a new one

There will be a follow up PR cleaning up the customizations from previous approach, that clean up is left out of this PR to ease the review process.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • [ ] Has associated issue:
  • [X] Required feature flags: FEATURE_CHART_PLUGINS_EXPERIMENTAL
  • [ ] 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

Antonio-RiveroMartnez avatar Mar 27 '24 21:03 Antonio-RiveroMartnez

Codecov Report

Attention: Patch coverage is 11.29032% with 55 lines in your changes are missing coverage. Please review.

Project coverage is 69.73%. Comparing base (349e496) to head (61d9923). Report is 44 commits behind head on master.

Files Patch % Lines
...plore/components/controls/ComparisonRangeLabel.tsx 9.09% 20 Missing :warning:
...ontrols/DateFilterControl/utils/dateFilterUtils.ts 15.78% 15 Missing and 1 partial :warning:
...Number/BigNumberPeriodOverPeriod/transformProps.ts 0.00% 10 Missing :warning:
.../BigNumber/BigNumberPeriodOverPeriod/buildQuery.ts 0.00% 9 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #27718      +/-   ##
==========================================
- Coverage   69.77%   69.73%   -0.05%     
==========================================
  Files        1911     1922      +11     
  Lines       75056    75273     +217     
  Branches     8362     8434      +72     
==========================================
+ Hits        52374    52493     +119     
- Misses      20630    20717      +87     
- Partials     2052     2063      +11     
Flag Coverage Δ
javascript 57.35% <9.83%> (-0.14%) :arrow_down:
mysql 77.89% <100.00%> (+<0.01%) :arrow_up:
postgres 78.00% <100.00%> (-0.02%) :arrow_down:
presto 53.63% <0.00%> (?)
python 83.03% <100.00%> (+0.11%) :arrow_up:
sqlite 77.44% <100.00%> (-0.02%) :arrow_down:
unit 56.77% <0.00%> (+0.01%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 27 '24 23:03 codecov[bot]

/testenv up

Antonio-RiveroMartnez avatar Mar 27 '24 23:03 Antonio-RiveroMartnez

@Antonio-RiveroMartnez Ephemeral environment spinning up at http://54.184.250.188:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Mar 27 '24 23:03 github-actions[bot]

/testenv up FEATURE_CHART_PLUGINS_EXPERIMENTAL=true

Antonio-RiveroMartnez avatar Mar 27 '24 23:03 Antonio-RiveroMartnez

@Antonio-RiveroMartnez Ephemeral environment spinning up at http://35.166.80.185:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Mar 27 '24 23:03 github-actions[bot]

/testenv up FEATURE_CHART_PLUGINS_EXPERIMENTAL=true

Antonio-RiveroMartnez avatar Mar 29 '24 04:03 Antonio-RiveroMartnez

@Antonio-RiveroMartnez Ephemeral environment spinning up at http://35.167.243.15:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Mar 29 '24 04:03 github-actions[bot]

/testenv up FEATURE_CHART_PLUGINS_EXPERIMENTAL=true

Antonio-RiveroMartnez avatar Apr 25 '24 15:04 Antonio-RiveroMartnez

@Antonio-RiveroMartnez Ephemeral environment spinning up at http://34.221.145.242:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Apr 25 '24 15:04 github-actions[bot]

/testenv up FEATURE_CHART_PLUGINS_EXPERIMENTAL=true

Antonio-RiveroMartnez avatar Apr 25 '24 16:04 Antonio-RiveroMartnez

@Antonio-RiveroMartnez Ephemeral environment spinning up at http://34.215.133.163:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Apr 25 '24 17:04 github-actions[bot]

/testenv up FEATURE_CHART_PLUGINS_EXPERIMENTAL=true

Antonio-RiveroMartnez avatar Apr 26 '24 09:04 Antonio-RiveroMartnez

@Antonio-RiveroMartnez Ephemeral environment spinning up at http://54.245.212.136:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Apr 26 '24 10:04 github-actions[bot]

/testenv up FEATURE_CHART_PLUGINS_EXPERIMENTAL=true

Antonio-RiveroMartnez avatar Apr 30 '24 16:04 Antonio-RiveroMartnez

@Antonio-RiveroMartnez Ephemeral environment spinning up at http://34.218.244.115:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Apr 30 '24 16:04 github-actions[bot]

/testenv up FEATURE_CHART_PLUGINS_EXPERIMENTAL=true

Antonio-RiveroMartnez avatar May 01 '24 18:05 Antonio-RiveroMartnez

@Antonio-RiveroMartnez Ephemeral environment spinning up at http://34.223.248.234:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar May 01 '24 19:05 github-actions[bot]

@Antonio-RiveroMartnez I added the hold:testing label to this PR. I'll wait for your rebase and will test the changes using Airbnb's production data, the same way I did for https://github.com/apache/superset/pull/28432 just to confirm that the time-shifts remain in sync with legacy charts.

michael-s-molina avatar May 15 '24 11:05 michael-s-molina

Ephemeral environment shutdown and build artifacts deleted.

github-actions[bot] avatar May 16 '24 16:05 github-actions[bot]