hughhhh commented on code in PR #20862:
URL: https://github.com/apache/superset/pull/20862#discussion_r933633325
##########
superset/datasets/dao.py:
##########
@@ -147,14 +147,22 @@ def validate_metrics_uniqueness(dataset_id: int,
metrics_names: List[str]) -> bo
@classmethod
def update(
- cls, model: SqlaTable, properties: Dict[str, Any], commit: bool = True
+ cls,
+ model: SqlaTable,
+ properties: Dict[str, Any],
+ commit: bool = True,
) -> Optional[SqlaTable]:
"""
Updates a Dataset model on the metadata DB
"""
if "columns" in properties:
- cls.update_columns(model, properties.pop("columns"), commit=commit)
+ cls.update_columns(
+ model,
+ properties.pop("columns"),
+ commit=commit,
+ override_columns=bool(properties.get("override_columns")),
+ )
if "metrics" in properties:
cls.update_metrics(model, properties.pop("metrics"), commit=commit)
Review Comment:
from sqllab, we don't allow users to create metrics so if you look at the
`update_metrics` function we end up just deleting all the rows since
`properties["metrics"]` is always None from that context.
--
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]