villebro commented on a change in pull request #17379:
URL: https://github.com/apache/superset/pull/17379#discussion_r798443474



##########
File path: superset/viz.py
##########
@@ -303,19 +308,30 @@ def process_query_filters(self) -> None:
         merge_extra_filters(self.form_data)
         utils.split_adhoc_filters_into_base_filters(self.form_data)
 
+    @staticmethod
+    def dedup_columns(*columns_args: Optional[List[Column]]) -> List[Column]:
+        # dedup groupby and columns while preserving order
+        labels: List[str] = []
+        deduped_columns: List[Column] = []
+        for columns in columns_args:
+            for column in columns or []:
+                label = get_column_name(column)
+                if label not in labels:
+                    deduped_columns.append(column)

Review comment:
       I did a quick test, and it seems the legacy pivot table does work with 
overlapping groupby and column names:
   
![image](https://user-images.githubusercontent.com/33317356/152329475-fa7954b0-6848-4d49-b6b7-98d35d54615b.png)
   




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

Reply via email to