mirror of
https://github.com/apache/superset.git
synced 2024-09-06 05:47:43 -04:00
fix: make dataset update methods static instead of global (#16044)
This commit is contained in:
parent
7b15b7690d
commit
7c059cda39
@ -1690,7 +1690,7 @@ class DruidDatasource(Model, BaseDatasource):
|
||||
latest_metadata = self.latest_metadata() or {}
|
||||
return [{"name": k, "type": v.get("type")} for k, v in latest_metadata.items()]
|
||||
|
||||
|
||||
@staticmethod
|
||||
def update_datasource(
|
||||
_mapper: Mapper, _connection: Connection, obj: Union[DruidColumn, DruidMetric]
|
||||
) -> None:
|
||||
@ -1710,5 +1710,5 @@ def update_datasource(
|
||||
|
||||
sa.event.listen(DruidDatasource, "after_insert", security_manager.set_perm)
|
||||
sa.event.listen(DruidDatasource, "after_update", security_manager.set_perm)
|
||||
sa.event.listen(DruidMetric, "after_update", update_datasource)
|
||||
sa.event.listen(DruidColumn, "after_update", update_datasource)
|
||||
sa.event.listen(DruidMetric, "after_update", DruidDatasource.update_datasource)
|
||||
sa.event.listen(DruidColumn, "after_update", DruidDatasource.update_datasource)
|
||||
|
@ -1653,7 +1653,7 @@ class SqlaTable( # pylint: disable=too-many-public-methods,too-many-instance-at
|
||||
):
|
||||
raise Exception(get_dataset_exist_error_msg(target.full_name))
|
||||
|
||||
|
||||
@staticmethod
|
||||
def update_table(
|
||||
_mapper: Mapper, _connection: Connection, obj: Union[SqlMetric, TableColumn]
|
||||
) -> None:
|
||||
@ -1671,8 +1671,8 @@ def update_table(
|
||||
sa.event.listen(SqlaTable, "after_insert", security_manager.set_perm)
|
||||
sa.event.listen(SqlaTable, "after_update", security_manager.set_perm)
|
||||
sa.event.listen(SqlaTable, "before_update", SqlaTable.before_update)
|
||||
sa.event.listen(SqlMetric, "after_update", update_table)
|
||||
sa.event.listen(TableColumn, "after_update", update_table)
|
||||
sa.event.listen(SqlMetric, "after_update", SqlaTable.update_table)
|
||||
sa.event.listen(TableColumn, "after_update", SqlaTable.update_table)
|
||||
|
||||
RLSFilterRoles = Table(
|
||||
"rls_filter_roles",
|
||||
|
Loading…
Reference in New Issue
Block a user