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/06/22 22:20:04 UTC
[GitHub] [superset] john-bodley commented on a diff in pull request #24488: chore(dao): Add explicit ON DELETE CASCADE when deleting datasets
john-bodley commented on code in PR #24488:
URL: https://github.com/apache/superset/pull/24488#discussion_r1239082684
##########
superset/daos/dataset.py:
##########
@@ -364,17 +364,6 @@ def create_metric(
@staticmethod
def bulk_delete(models: Optional[list[SqlaTable]], commit: bool = True) -> None:
item_ids = [model.id for model in models] if models else []
- # bulk delete, first delete related data
Review Comment:
I'm not sure if this was required because when you bulk delete a table (using the `delete()` method) you bypass the ORM and that's where the cascade logic resides, but given we've adopted the "shift left" mentality it's something of a moot point, i.e., the database will handle the deletion irrespective of how the records are deleted (SQLAlchemy ORM, raw connection, MySQL/PostgreSQL CLI, etc.).
--
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