You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "john-bodley (via GitHub)" <gi...@apache.org> on 2023/08/19 05:18:09 UTC
[GitHub] [superset] john-bodley commented on a diff in pull request #25031: fix: Ensure SQLAlchemy sessions are closed
john-bodley commented on code in PR #25031:
URL: https://github.com/apache/superset/pull/25031#discussion_r1299104325
##########
superset/tags/models.py:
##########
@@ -181,6 +181,7 @@ def after_insert(
session.add(tagged_object)
session.commit()
+ session.close()
Review Comment:
The various SQLAlchemy hooks, `after_insert`, `after_delete`, etc. pass in the connection from which we instantiate a new session which was never closed. I'm really not sure what's wrong with simply using the Flask-SQLAlchemy session, i.e., `db.session`.
##########
superset/models/dashboard.py:
##########
@@ -414,13 +415,12 @@ def export_dashboards( # pylint: disable=too-many-locals
"native_filter_configuration", []
)
for native_filter in native_filter_configuration:
- session = db.session()
Review Comment:
This session was never closed, though it's unclear why a new session was created.
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org