From 273485d7e414d08d483a7cabe924db9ee3af94b4 Mon Sep 17 00:00:00 2001 From: Craig Date: Wed, 20 Sep 2023 08:01:56 -0700 Subject: [PATCH] Refactoring --- superset/async_events/async_query_manager_factory.py | 10 +++++----- superset/extensions/__init__.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/superset/async_events/async_query_manager_factory.py b/superset/async_events/async_query_manager_factory.py index d641530ba748d..2e05f38603450 100644 --- a/superset/async_events/async_query_manager_factory.py +++ b/superset/async_events/async_query_manager_factory.py @@ -23,13 +23,13 @@ class AsyncQueryManagerFactory: def __init__(self) -> None: - self.async_query_manager: AsyncQueryManager = None # type: ignore + self._async_query_manager: AsyncQueryManager = None # type: ignore def init_app(self, app: Flask) -> None: - self.async_query_manager = load_class_from_name( + self._async_query_manager = load_class_from_name( app.config["GLOBAL_ASYNC_QUERY_MANAGER_CLASS"] )() - self.async_query_manager.init_app(app) + self._async_query_manager.init_app(app) - def get(self) -> AsyncQueryManager: - return self.async_query_manager + def instance(self) -> AsyncQueryManager: + return self._async_query_manager diff --git a/superset/extensions/__init__.py b/superset/extensions/__init__.py index 035fac13e35ad..23924cac5ba8a 100644 --- a/superset/extensions/__init__.py +++ b/superset/extensions/__init__.py @@ -116,7 +116,7 @@ def init_app(self, app: Flask) -> None: APP_DIR = os.path.join(os.path.dirname(__file__), os.path.pardir) appbuilder = AppBuilder(update_perms=False) async_query_manager_factory = AsyncQueryManagerFactory() -async_query_manager: AsyncQueryManager = LocalProxy(async_query_manager_factory.get) +async_query_manager: AsyncQueryManager = LocalProxy(async_query_manager_factory.instance) cache_manager = CacheManager() celery_app = celery.Celery() csrf = CSRFProtect()