From 1752d0004a36a08451454e029903847db0088f82 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Sat, 14 Sep 2024 18:45:10 +0000 Subject: [PATCH 1/2] fix(examples): fix examples uri for sqlite --- superset/config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/superset/config.py b/superset/config.py index d43028fe64410..b431a85164927 100644 --- a/superset/config.py +++ b/superset/config.py @@ -45,7 +45,7 @@ from flask_appbuilder.security.manager import AUTH_DB from flask_caching.backends.base import BaseCache from pandas import Series -from pandas._libs.parsers import STR_NA_VALUES +from pandas._libs.parsers import STR_NA_VALUES # pylint: disable=no-name-in-module from sqlalchemy.engine.url import URL from sqlalchemy.orm.query import Query @@ -1632,7 +1632,9 @@ def EMAIL_HEADER_MUTATOR( # pylint: disable=invalid-name,unused-argument # URI to database storing the example data, points to # SQLALCHEMY_DATABASE_URI by default if set to `None` -SQLALCHEMY_EXAMPLES_URI = "sqlite:///" + os.path.join(DATA_DIR, "examples.db") +SQLALCHEMY_EXAMPLES_URI = ( + f"""sqlite:///{os.path.join(DATA_DIR, "examples.db")}?check_same_thread=false""" +) # Optional prefix to be added to all static asset paths when rendering the UI. # This is useful for hosting assets in an external CDN, for example From 09212c82ba9c794febccd4a9eb66b739b0768a32 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Sat, 14 Sep 2024 18:52:27 +0000 Subject: [PATCH 2/2] lint --- superset/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superset/config.py b/superset/config.py index b431a85164927..b70b288306f62 100644 --- a/superset/config.py +++ b/superset/config.py @@ -45,7 +45,7 @@ from flask_appbuilder.security.manager import AUTH_DB from flask_caching.backends.base import BaseCache from pandas import Series -from pandas._libs.parsers import STR_NA_VALUES # pylint: disable=no-name-in-module +from pandas._libs.parsers import STR_NA_VALUES from sqlalchemy.engine.url import URL from sqlalchemy.orm.query import Query @@ -1633,7 +1633,7 @@ def EMAIL_HEADER_MUTATOR( # pylint: disable=invalid-name,unused-argument # URI to database storing the example data, points to # SQLALCHEMY_DATABASE_URI by default if set to `None` SQLALCHEMY_EXAMPLES_URI = ( - f"""sqlite:///{os.path.join(DATA_DIR, "examples.db")}?check_same_thread=false""" + "sqlite:///" + os.path.join(DATA_DIR, "examples.db") + "?check_same_thread=false" ) # Optional prefix to be added to all static asset paths when rendering the UI.