Revert "chore: Cleanup database sessions (#10427)" (#10537)

This reverts commit 7645fc85c3.
This commit is contained in:
Erik Ritter
2020-08-06 15:33:48 -07:00
committed by GitHub
parent 2055ecc1ba
commit fd2d1c58c5
39 changed files with 637 additions and 488 deletions

View File

@@ -47,7 +47,7 @@ class Datasource(BaseSupersetView):
datasource_type = datasource_dict.get("type")
database_id = datasource_dict["database"].get("id")
orm_datasource = ConnectorRegistry.get_datasource(
datasource_type, datasource_id
datasource_type, datasource_id, db.session
)
orm_datasource.database_id = database_id
@@ -82,7 +82,7 @@ class Datasource(BaseSupersetView):
def get(self, datasource_type: str, datasource_id: int) -> FlaskResponse:
try:
orm_datasource = ConnectorRegistry.get_datasource(
datasource_type, datasource_id
datasource_type, datasource_id, db.session
)
if not orm_datasource.data:
return json_error_response(
@@ -102,7 +102,7 @@ class Datasource(BaseSupersetView):
"""Gets column info from the source system"""
if datasource_type == "druid":
datasource = ConnectorRegistry.get_datasource(
datasource_type, datasource_id
datasource_type, datasource_id, db.session
)
elif datasource_type == "table":
database = (