suddjian commented on a change in pull request #9530: [charts] adds new filters 
ui
URL: 
https://github.com/apache/incubator-superset/pull/9530#discussion_r410388327
 
 

 ##########
 File path: superset/charts/dao.py
 ##########
 @@ -51,3 +56,25 @@ def bulk_delete(models: Optional[List[Slice]], commit: bool 
= True) -> None:
             if commit:
                 db.session.rollback()
             raise ex
+
+    @staticmethod
+    def fetch_unique_column_values(column_name: str) -> List:
+        return [
+            val[0]
+            for val in db.session.query(getattr(Slice, 
column_name)).distinct().all()
+        ]
+
+    @staticmethod
+    def fetch_unique_datasources() -> Optional[List["BaseDatasource"]]:
 
 Review comment:
   This looks fine, but UX note: It might be confusing to only be able to 
filter by datasources that are used in charts. Using a list of all datasources 
and handling unused ones with an empty state in the UI might be more ideal.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to