You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/11/06 20:04:45 UTC

[GitHub] [superset] hughhhh commented on a diff in pull request #21943: feat: refactor all `get_sqla_engine` to use contextmanager in codebase

hughhhh commented on code in PR #21943:
URL: https://github.com/apache/superset/pull/21943#discussion_r1014884869


##########
superset/db_engine_specs/base.py:
##########
@@ -472,7 +472,10 @@ def get_engine(
         schema: Optional[str] = None,
         source: Optional[utils.QuerySource] = None,
     ) -> Engine:
-        return database.get_sqla_engine(schema=schema, source=source)
+        with database.get_sqla_engine_with_context(
+            schema=schema, source=source
+        ) as engine:
+            return engine

Review Comment:
   so should i just `return database._ get_sqla_engine()`



-- 
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