[Explore view] Fix extra data fetch when user clicks Run Query#8070
Merged
graceguo-supercat merged 1 commit intoAug 20, 2019
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8070 +/- ##
==========================================
+ Coverage 65.57% 65.58% +0.01%
==========================================
Files 469 469
Lines 22496 22492 -4
Branches 2446 2445 -1
==========================================
Hits 14752 14752
+ Misses 7624 7620 -4
Partials 120 120
Continue to review full report at Codecov.
|
etr2460
approved these changes
Aug 19, 2019
Member
etr2460
left a comment
There was a problem hiding this comment.
assuming i understand this, lgtm
|
|
||
| /* eslint no-unused-vars: 0 */ | ||
| componentDidUpdate(prevProps, prevState) { | ||
| this.triggerQueryIfNeeded(); |
Member
There was a problem hiding this comment.
This can be removed because the child component is handling the refresh, correct?
Author
There was a problem hiding this comment.
graceguo-supercat
pushed a commit
to graceguo-supercat/superset
that referenced
this pull request
Aug 20, 2019
villebro
pushed a commit
that referenced
this pull request
Sep 27, 2019
cccs-rc
pushed a commit
to CybercentreCanada/superset
that referenced
this pull request
Mar 6, 2024
qfcwell
pushed a commit
to qfcwell/superset
that referenced
this pull request
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CATEGORY
Choose one
SUMMARY
In explore view, when user change controls and run query again, data fetch are triggered twice. see the animated gif below.
I believe this issue was introduced since #7233. Before that, dashboard will trigger new queries for all charts in dashboard when filter is updated, even for those charts are under nested tabs and not visible.
In #7233, we only updated query parameters when filter is updated, but delayed the trigger for new query until chart becomes visible. Instead of call
postChartFormDatato trigger data fetching API, I added acomponentDidupdatemethod for chart component, and use react component state change and triggerQuery flag to trigger the data fetch.Currently explore view container component it also has componentDidUpdate, it will call data fetching API on parent component updated. Together with chart's componentDidupdate change, that's the reason data fetching is called twice.
Solution:
Do not need to call
postChartFormDatafrom exploreview container component.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
After

TEST PLAN
CI and manual test
REVIEWERS
@etr2460 @michellethomas