mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
feat: refactor all get_sqla_engine to use contextmanager in codebase (#21943)
This commit is contained in:
@@ -1284,8 +1284,8 @@ def get_example_default_schema() -> Optional[str]:
|
||||
Return the default schema of the examples database, if any.
|
||||
"""
|
||||
database = get_example_database()
|
||||
engine = database.get_sqla_engine()
|
||||
return inspect(engine).default_schema_name
|
||||
with database.get_sqla_engine_with_context() as engine:
|
||||
return inspect(engine).default_schema_name
|
||||
|
||||
|
||||
def backend() -> str:
|
||||
|
||||
Reference in New Issue
Block a user