mirror of
https://github.com/apache/superset.git
synced 2026-05-06 16:34:32 +00:00
chore: proper current_app.config proxy usage (#34345)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
6c9cda758a
commit
cb27d5fe8d
@@ -19,7 +19,7 @@ from __future__ import annotations
|
||||
import logging
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from flask import current_app
|
||||
from flask import current_app as app
|
||||
|
||||
from superset.constants import EXAMPLES_DB_UUID
|
||||
|
||||
@@ -64,11 +64,15 @@ def get_or_create_db(
|
||||
|
||||
|
||||
def get_example_database() -> Database:
|
||||
return get_or_create_db("examples", current_app.config["SQLALCHEMY_EXAMPLES_URI"])
|
||||
# pylint: disable=import-outside-toplevel
|
||||
|
||||
return get_or_create_db("examples", app.config["SQLALCHEMY_EXAMPLES_URI"])
|
||||
|
||||
|
||||
def get_main_database() -> Database:
|
||||
db_uri = current_app.config["SQLALCHEMY_DATABASE_URI"]
|
||||
# pylint: disable=import-outside-toplevel
|
||||
|
||||
db_uri = app.config["SQLALCHEMY_DATABASE_URI"]
|
||||
return get_or_create_db("main", db_uri)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user