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



##########
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 was just going through this feature and found pivot table allows same 
group by and column name, but looking at this function it's not expected.
   So I thought this might be incorrecct as its not really putting anything in 
`labels` list.
   So may need to add ```labels.append(label)``` here?




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