Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[logging] deprecation notices for SQLite #9662

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions superset/migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@
fileConfig(config.config_file_name)
logger = logging.getLogger("alembic.env")


config.set_main_option("sqlalchemy.url", current_app.config["SQLALCHEMY_DATABASE_URI"])
DATABASE_URI = current_app.config["SQLALCHEMY_DATABASE_URI"]
if "sqlite" in DATABASE_URI:
logger.info("SQLite DB support may not be supported by in future version")
config.set_main_option("sqlalchemy.url", DATABASE_URI)
target_metadata = Base.metadata # pylint: disable=no-member


# other values from the config, defined by the needs of env.py,
# can be acquired:
# my_important_option = config.get_main_option("my_important_option")
Expand Down
7 changes: 4 additions & 3 deletions superset/sql_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ def get_query(query_id, session):
@contextmanager
def session_scope(nullpool):
"""Provide a transactional scope around a series of operations."""
database_uri = app.config["SQLALCHEMY_DATABASE_URI"]
if "sqlite" in database_uri:
logger.info("SQLite DB support may not be supported by in future version")
if nullpool:
engine = sqlalchemy.create_engine(
app.config["SQLALCHEMY_DATABASE_URI"], poolclass=NullPool
)
engine = sqlalchemy.create_engine(database_uri, poolclass=NullPool)
session_class = sessionmaker()
session_class.configure(bind=engine)
session = session_class()
Expand Down
3 changes: 3 additions & 0 deletions tests/superset_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
if "SUPERSET__SQLALCHEMY_DATABASE_URI" in os.environ:
SQLALCHEMY_DATABASE_URI = os.environ["SUPERSET__SQLALCHEMY_DATABASE_URI"]

if "sqlite" in SQLALCHEMY_DATABASE_URI:
logger.info("SQLite DB support may not be supported by in future version")

SQL_MAX_ROW = 666
SQLLAB_CTAS_NO_LIMIT = True # SQL_MAX_ROW will not take affect for the CTA queries
FEATURE_FLAGS = {"foo": "bar", "KV_STORE": True, "SHARE_QUERIES_VIA_KV_STORE": True}
Expand Down
3 changes: 3 additions & 0 deletions tests/superset_test_config_thumbnails.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
if "SUPERSET__SQLALCHEMY_DATABASE_URI" in os.environ:
SQLALCHEMY_DATABASE_URI = os.environ["SUPERSET__SQLALCHEMY_DATABASE_URI"]

if "sqlite" in SQLALCHEMY_DATABASE_URI:
logger.info("SQLite DB support may not be supported by in future version")

SQL_SELECT_AS_CTA = True
SQL_MAX_ROW = 666

Expand Down