mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
fix: examples remove app context at the module level (#15546)
This commit is contained in:
committed by
GitHub
parent
08bda27a43
commit
0af5a3d600
@@ -23,7 +23,7 @@ from sqlalchemy import String, Text
|
||||
from superset import db
|
||||
from superset.utils.core import get_example_database
|
||||
|
||||
from .helpers import get_example_data, TBL
|
||||
from .helpers import get_example_data, get_table_connector_registry
|
||||
|
||||
|
||||
def load_bart_lines(only_metadata: bool = False, force: bool = False) -> None:
|
||||
@@ -53,9 +53,10 @@ def load_bart_lines(only_metadata: bool = False, force: bool = False) -> None:
|
||||
)
|
||||
|
||||
print("Creating table {} reference".format(tbl_name))
|
||||
tbl = db.session.query(TBL).filter_by(table_name=tbl_name).first()
|
||||
table = get_table_connector_registry()
|
||||
tbl = db.session.query(table).filter_by(table_name=tbl_name).first()
|
||||
if not tbl:
|
||||
tbl = TBL(table_name=tbl_name)
|
||||
tbl = table(table_name=tbl_name)
|
||||
tbl.description = "BART lines"
|
||||
tbl.database = database
|
||||
db.session.merge(tbl)
|
||||
|
||||
Reference in New Issue
Block a user