Vitor-Avila commented on code in PR #34993:
URL: https://github.com/apache/superset/pull/34993#discussion_r2319804638
##########
superset/commands/dataset/update.py:
##########
@@ -257,6 +265,16 @@ def validate_folders( # noqa: C901
*[column.uuid for column in columns],
}
+ # Add UUIDs from new metrics and columns in the payload
+ if new_metrics:
+ existing.update(
+ metric.get("uuid") for metric in new_metrics if metric.get("uuid")
+ )
+ if new_columns:
+ existing.update(
+ column.get("uuid") for column in new_columns if column.get("uuid")
+ )
Review Comment:
Hmm I think we need a different approach here. In case the update payload
includes `columns` or `metrics`, they would replace the existing columns or
metrics in the DB. So instead of appending the new `uuid` values to `existing`,
we should consider only the new ones if present.
Might be easier to keep `validate_folders` as is, but then when calling it
pass `self._properties.get("metrics", self._model.metrics)` and
`self._properties.get("columns", self._model.columns)`. What do you think?
--
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]