You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/07/29 00:03:16 UTC

[GitHub] [superset] eschutho commented on a diff in pull request #20862: fix: overwrite update override columns on PUT /dataset

eschutho commented on code in PR #20862:
URL: https://github.com/apache/superset/pull/20862#discussion_r932764925


##########
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:
   for put /dataset, does override_columns literally mean just the columns? Are we putting or patching here? Does it include the dataset? Wouldn't we be also overriding the metrics?



-- 
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