Skip to content

Commit

Permalink
fix: typing difficulties
Browse files Browse the repository at this point in the history
  • Loading branch information
amitmiran137 committed Aug 9, 2021
1 parent 747677e commit 45888ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
logger = logging.getLogger(__name__)

if TYPE_CHECKING:
from tasks.cache import Strategy
from flask_appbuilder.security.sqla import models # pylint: disable=unused-import

from superset.connectors.sqla.models import ( # pylint: disable=unused-import
Expand Down Expand Up @@ -706,7 +705,7 @@ class CeleryConfig: # pylint: disable=too-few-public-methods
CELERY_CONFIG = CeleryConfig # pylint: disable=invalid-name

# Additional Caching strategies to be used in the CELERYBEAT_SCHEDULE config
EXTRA_CACHING_STRATEGIES: List[Strategy] = []
EXTRA_CACHING_STRATEGIES = []

# Set celery config to None to disable all the above configuration
# CELERY_CONFIG = None
Expand Down
4 changes: 2 additions & 2 deletions superset/tasks/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def get_urls(self) -> List[str]:
return urls


strategies : List[Strategy] = [DummyStrategy, TopNDashboardsStrategy, DashboardTagsStrategy]
strategies = [DummyStrategy, TopNDashboardsStrategy, DashboardTagsStrategy]


@celery_app.task(name="cache-warmup")
Expand All @@ -268,7 +268,7 @@ def cache_warmup(
logger.info("Loading strategy")
class_ = None

extra_strategies: List[Strategy] = app.config["EXTRA_CACHING_STRATEGIES"]
extra_strategies = app.config["EXTRA_CACHING_STRATEGIES"]
for class_ in strategies + extra_strategies:
if class_.name == strategy_name: # type: ignore
break
Expand Down

0 comments on commit 45888ea

Please sign in to comment.