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/15 18:28:29 UTC

[GitHub] [superset] eschutho commented on a diff in pull request #22129: add back database lookup from sip 68 revert

eschutho commented on code in PR #22129:
URL: https://github.com/apache/superset/pull/22129#discussion_r1023131839


##########
superset/datasets/dao.py:
##########
@@ -37,26 +36,6 @@ class DatasetDAO(BaseDAO):  # pylint: disable=too-many-public-methods
     model_cls = SqlaTable
     base_filter = DatasourceFilter
 
-    @classmethod
-    def find_by_ids(cls, model_ids: Union[List[str], List[int]]) -> List[SqlaTable]:
-        """
-        Find a List of models by a list of ids, if defined applies `base_filter`
-        """
-        id_col = getattr(SqlaTable, cls.id_column_name, None)
-        if id_col is None:
-            return []
-
-        # the joinedload option ensures that the database is
-        # available in the session later and not lazy loaded
-        query = (
-            db.session.query(SqlaTable)
-            .options(joinedload(SqlaTable.database))
-            .filter(id_col.in_(model_ids))
-        )
-        data_model = SQLAInterface(SqlaTable, db.session)
-        query = DatasourceFilter(cls.id_column_name, data_model).apply(query, None)
-        return query.all()
-

Review Comment:
   This method was added in to the original PR to eager load the database. 



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