john-bodley commented on code in PR #25031: URL: https://github.com/apache/superset/pull/25031#discussion_r1299106866
########## superset/tasks/cache.py: ########## @@ -96,6 +96,7 @@ class DummyStrategy(Strategy): # pylint: disable=too-few-public-methods def get_payloads(self) -> list[dict[str, int]]: session = db.create_scoped_session() charts = session.query(Slice).all() + session.close() Review Comment: I gather these standalone scoped sessions exist because tasks fall outside the jurisdiction of Flask. If this isn't the case then—to adhere to the KISS priniciple—we should simply reuse the Flask-SQLAlchemy session. ########## superset/tasks/cache.py: ########## @@ -96,6 +96,7 @@ class DummyStrategy(Strategy): # pylint: disable=too-few-public-methods def get_payloads(self) -> list[dict[str, int]]: session = db.create_scoped_session() charts = session.query(Slice).all() + session.close() Review Comment: I gather these standalone scoped sessions exist because tasks fall outside the jurisdiction of Flask. If this isn't the case then—to adhere to the KISS priniciple—we should simply reuse the Flask-SQLAlchemy session. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org