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(plugins): Fix dashboard filter for Table and Big Number with Time Comparison #29517

Conversation

Antonio-RiveroMartnez
Copy link
Member

SUMMARY

When a dashboard is using the Table viz or the BigNumber viz with Time comparison, any time filter used in the dashboard is ignored by the charts. This PR address that fix and prevent an index out of range too.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Test.mov

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

- Fix dashboard time filter not being applied to charts
- Prevent list index out of range when there's time_grain and not a join_keys list
@dosubot dosubot bot added dashboard:filtersets Related to the filtersets of the Dashboard viz:charts:bignumber Related to BigNumber charts viz:charts:table Related to the Table chart labels Jul 8, 2024
Copy link

codecov bot commented Jul 8, 2024

Codecov Report

Attention: Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.

Project coverage is 70.33%. Comparing base (76d897e) to head (b48b71c).
Report is 966 commits behind head on master.

Files with missing lines Patch % Lines
...src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx 0.00% 2 Missing ⚠️
.../BigNumber/BigNumberPeriodOverPeriod/buildQuery.ts 0.00% 1 Missing ⚠️
...Number/BigNumberPeriodOverPeriod/transformProps.ts 0.00% 1 Missing ⚠️
...ntend/plugins/plugin-chart-table/src/buildQuery.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #29517      +/-   ##
==========================================
+ Coverage   60.48%   70.33%   +9.84%     
==========================================
  Files        1931     1967      +36     
  Lines       76236    78426    +2190     
  Branches     8568     8972     +404     
==========================================
+ Hits        46114    55163    +9049     
+ Misses      28017    21065    -6952     
- Partials     2105     2198      +93     
Flag Coverage Δ
hive 49.03% <0.00%> (-0.13%) ⬇️
javascript 58.05% <16.66%> (+0.33%) ⬆️
mysql 77.01% <100.00%> (?)
postgres 77.12% <100.00%> (?)
presto 53.64% <0.00%> (-0.16%) ⬇️
python 83.69% <100.00%> (+20.20%) ⬆️
sqlite 76.59% <100.00%> (?)
unit 59.62% <100.00%> (+1.99%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yousoph
Copy link
Member

yousoph commented Jul 8, 2024

/testenv up FLAG_CHART_PLUGINS_EXPERIMENTAL=True

Copy link
Contributor

github-actions bot commented Jul 8, 2024

@yousoph Ephemeral environment spinning up at http://52.42.137.198:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

Nice!

Comment on lines +595 to +597
if join_keys:
col = df.pop(join_keys[0])
df.insert(0, col.name, col)
Copy link
Member

Choose a reason for hiding this comment

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

Is there always going to be a single join key? Should we future-proof this by doing:

Suggested change
if join_keys:
col = df.pop(join_keys[0])
df.insert(0, col.name, col)
for join_key in join_keys:
col = df.pop(join_key)
df.insert(0, col.name, col)

@Antonio-RiveroMartnez Antonio-RiveroMartnez merged commit 9052f9f into apache:master Jul 8, 2024
39 of 40 checks passed
Copy link
Contributor

github-actions bot commented Jul 8, 2024

Ephemeral environment shutdown and build artifacts deleted.

eschutho pushed a commit that referenced this pull request Jul 24, 2024
@github-actions github-actions bot added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.1.0 labels Nov 14, 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 dashboard:filtersets Related to the filtersets of the Dashboard plugins size/M viz:charts:bignumber Related to BigNumber charts viz:charts:table Related to the Table chart 🚢 4.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants