zephyring commented on code in PR #24894:
URL: https://github.com/apache/superset/pull/24894#discussion_r1286158038
##########
superset/daos/dataset.py:
##########
@@ -360,42 +359,6 @@ def create_metric(
"""
return DatasetMetricDAO.create(properties, commit=commit)
- @classmethod
- def delete(
- cls,
- items: SqlaTable | list[SqlaTable],
- commit: bool = True,
- ) -> None:
- """
- Delete the specified items(s) including their associated relationships.
-
- Note that bulk deletion via `delete` does not dispatch the
`after_delete` event
- and thus the ORM event listener callback needs to be invoked manually.
-
- :param items: The item(s) to delete
- :param commit: Whether to commit the transaction
- :raises DAODeleteFailedError: If the deletion failed
- :see: https://docs.sqlalchemy.org/en/latest/orm/queryguide/dml.html
- """
-
- try:
- db.session.query(SqlaTable).filter(
- SqlaTable.id.in_(item.id for item in get_iterable(items))
- ).delete(synchronize_session="fetch")
-
- connection = db.session.connection()
- mapper = next(iter(cls.model_cls.registry.mappers)) # type: ignore
-
- for item in get_iterable(items):
- security_manager.dataset_after_delete(mapper, connection, item)
Review Comment:
this logic is still valid to be removed?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]