dpgaspar commented on code in PR #25043:
URL: https://github.com/apache/superset/pull/25043#discussion_r1305955032
##########
superset/security/manager.py:
##########
@@ -1338,14 +1338,20 @@ def dataset_after_update(
:param target: The changed dataset object
:return:
"""
+ # pylint: disable=import-outside-toplevel
+ from superset.connectors.sqla.models import SqlaTable
+
# Check if watched fields have changed
- state = inspect(target)
- history_database = state.get_history("database_id", True)
- history_table_name = state.get_history("table_name", True)
- history_schema = state.get_history("schema", True)
+ table = SqlaTable.__table__
+ current_dataset = connection.execute(
+ table.select().where(table.c.id == target.id)
+ ).one()
+ current_db_id = current_dataset.database_id
+ current_schema = current_dataset.schema
+ current_table_name = current_dataset.table_name
# When database name changes
- if history_database.has_changes() and history_database.deleted:
+ if current_db_id != target.database_id:
Review Comment:
forget it, those cases are covered on the next if statements
--
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]