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

chore: Using cache factory method #10887

Merged

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Sep 15, 2020

SUMMARY

Switching the cache manager to use the factory method which allows the cache to be used within blueprints et al. prior to being bound to the application. This approach is also a step in the preferred direction, i.e., away from the legacy configuration defined here.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

CI.

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

@@ -24,28 +24,24 @@ class CacheManager:
def __init__(self) -> None:
super().__init__()

self._tables_cache = None
self._cache = None
Copy link
Member Author

@john-bodley john-bodley Sep 15, 2020

Choose a reason for hiding this comment

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

It's interesting that the

@property
def cache(self) -> Cache:
    return self._cache

method didn't barf from a MyPy perspective given that self._cache is actually Optional[Cache] per the definition on line 28.

@john-bodley john-bodley force-pushed the john-bodley--cache-factory-method branch from c573cb9 to 5f25d09 Compare September 15, 2020 06:44
@pull-request-size pull-request-size bot added size/M and removed size/S labels Sep 15, 2020
@john-bodley john-bodley force-pushed the john-bodley--cache-factory-method branch from 5f25d09 to dc79c53 Compare September 15, 2020 07:34
@john-bodley john-bodley marked this pull request as ready for review September 15, 2020 07:44
@john-bodley john-bodley force-pushed the john-bodley--cache-factory-method branch from dc79c53 to d3eea2c Compare September 15, 2020 08:03
@pull-request-size pull-request-size bot added size/L and removed size/M labels Sep 15, 2020
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 cleanup!

@john-bodley john-bodley merged commit b48dd4b into apache:master Sep 15, 2020
@john-bodley john-bodley deleted the john-bodley--cache-factory-method branch September 15, 2020 19:48
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
Co-authored-by: John Bodley <john.bodley@airbnb.com>
@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/L 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants