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

feature: Adding extra_filters to warm_up_cache #10675

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Aug 25, 2020

SUMMARY

At Airbnb on a nightly basis we warm up recently consumed dashboard slices, which adheres to the default dashboard filters (if applicable). We carried out an analysis which modeled how various factored contributed to the cache hit rate and cache efficiency rate, i.e., what proportion of pre-warmed payloads were actually consumed.

A clear mechanism for increasing the cache hit rate seems to be to warm up dashboard slices with specified filters (and not simply rely on the default) based on event logs (which were fixed in #10197). This PR provides a mechanism for providing the dashboard filters (which materialize as extra_filters in the form-data). If not specified it falls back to using the default dashboard filters which is the current logic.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

CI and added unit tests.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@@ -1437,6 +1437,7 @@ def warm_up_cache( # pylint: disable=too-many-locals,no-self-use
dashboard_id = request.args.get("dashboard_id")
table_name = request.args.get("table_name")
db_name = request.args.get("db_name")
extra_filters = request.args.get("extra_filters")
Copy link
Member

Choose a reason for hiding this comment

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

it would be great if you could add comment section on how would it be possible to fetch extra_filters for the dashboards / charts

Copy link
Member

@bkyryliuk bkyryliuk left a comment

Choose a reason for hiding this comment

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

nice feature !

[{"slice_id": slc.id, "viz_error": None, "viz_status": "success"}],
)

self.assertEqual(
Copy link
Member

Choose a reason for hiding this comment

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

use assert == as per pytest convention

@john-bodley john-bodley force-pushed the john-bodley--warm-up-cache-extra-filters branch 2 times, most recently from 5df3435 to f5a2fac Compare August 25, 2020 21:36
@john-bodley john-bodley force-pushed the john-bodley--warm-up-cache-extra-filters branch from f5a2fac to 24bbafa Compare August 25, 2020 21:57
@john-bodley john-bodley merged commit 502f4db into apache:master Aug 25, 2020
@john-bodley john-bodley deleted the john-bodley--warm-up-cache-extra-filters branch August 25, 2020 22:19
Ofeknielsen pushed a commit to ofekisr/incubator-superset that referenced this pull request Oct 5, 2020
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
@benceorlai
Copy link

Roadmap: apache-superset/superset-roadmap#74

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.0 labels Mar 12, 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/S 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants