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

"View as table" option on graphs/slices does not bypass the cache #28603

Open
2 of 3 tasks
calles-work opened this issue May 20, 2024 · 1 comment
Open
2 of 3 tasks

"View as table" option on graphs/slices does not bypass the cache #28603

calles-work opened this issue May 20, 2024 · 1 comment
Labels
dashboard Namespace | Anything related to the Dashboard

Comments

@calles-work
Copy link

Bug description

The "view as table" view does not update it's content past the first interaction, when the same query is used (including filter options, like time range), within the caching window when caching is enabled.
Whilst the graphs/slices seem to use the cache accordingly and update their content on dashboard refreshes, the "view as table" option does not.

How to reproduce the bug

Enabled cahing in superset_config.py.
I have the following cache settings enabled:
DATA_CACHE_CONFIG = { 'CACHE_TYPE: 'SimpleCache', 'CACHE_DEFAULT_TIMEOUT': 60*60*24, 'CACHE_THRESHOLD': 10000, }

Go to a dashboard and select "view as table" on a graph/slice.

Close the "view as table" pop up.

Wait until the dashboard has been refreshed, or force refresh it yourself, and until new data has been received for the relevant graph/slice.

Without changing the query (including filter options), select "view as table" on the same graph/slice as before.

The presented data should by the same as the first time "view as table" was viewed.

Screenshots/recordings

First interaction with "view as table" in caching window:
Screenshot from 2024-05-20 16-38-01

Second interaction with "view as table" in caching window on same graph after dashboard refresh with new data:
Screenshot from 2024-05-20 16-38-49

Superset version

4.0.1

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Copy link

dosubot bot commented May 20, 2024

It looks like the issue with the "view as table" feature not updating correctly in Superset might be related to how the feature interacts with the caching mechanism and how component updates are managed. Here are some targeted steps to troubleshoot and potentially resolve the issue:

  1. Ensure Proper Triggering of Refresh: Check that the forceRefresh method is correctly invoked to force a refresh of the chart. This method should be called with the appropriate parameters to ensure the table content is updated.

  2. Verify Chart Container Updates: Make sure the ChartContainer component, which renders the chart content including the "view as table" option, receives updated props that trigger a re-render when new data is available.

  3. Check for Prop Changes: In the Chart component, ensure that the shouldComponentUpdate method correctly identifies changes in data that should trigger a table update. This may involve adding logic to detect changes to queriesResponse or related data props.

  4. Debugging and Logging: Utilize logging to debug and track when refreshes are requested and when data is expected to update. This can help identify if the issue lies in not triggering updates or if updates are triggered but not reflected in the UI.

  5. Review Caching Logic: Review how caching is handled for the "view as table" data, especially ensuring that the cache is correctly invalidated or bypassed on a forced refresh.

If following these steps does not resolve the issue, it might be indicative of a bug in the Superset codebase, which could warrant further investigation or reporting as a new issue.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@dosubot dosubot bot added the dashboard Namespace | Anything related to the Dashboard label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard Namespace | Anything related to the Dashboard
Projects
None yet
Development

No branches or pull requests

1 participant