cccs-jc commented on a change in pull request #14507:
URL: https://github.com/apache/superset/pull/14507#discussion_r636948459



##########
File path: superset/jinja_context.py
##########
@@ -60,56 +71,10 @@ def context_addons() -> Dict[str, Any]:
     return current_app.config.get("JINJA_CONTEXT_ADDONS", {})
 
 
-def filter_values(column: str, default: Optional[str] = None) -> List[str]:
-    """Gets a values for a particular filter as a list
-
-    This is useful if:
-        - you want to use a filter box to filter a query where the name of 
filter box
-          column doesn't match the one in the select statement
-        - you want to have the ability for filter inside the main query for 
speed
-          purposes
-
-    Usage example::
-
-        SELECT action, count(*) as times
-        FROM logs
-        WHERE action in ( {{ "'" + "','".join(filter_values('action_type')) + 
"'" }} )
-        GROUP BY action
-
-    :param column: column/filter name to lookup
-    :param default: default value to return if there's no matching columns
-    :return: returns a list of filter values
-    """
-
-    from superset.views.utils import get_form_data
-
-    form_data, _ = get_form_data()
-    convert_legacy_filters_into_adhoc(form_data)
-    merge_extra_filters(form_data)
-
-    return_val = [
-        comparator
-        for filter in form_data.get("adhoc_filters", [])
-        for comparator in (
-            filter["comparator"]
-            if isinstance(filter["comparator"], list)
-            else [filter["comparator"]]
-        )
-        if (
-            filter.get("expressionType") == "SIMPLE"
-            and filter.get("clause") == "WHERE"
-            and filter.get("subject") == column
-            and filter.get("comparator")
-        )
-    ]
-
-    if return_val:
-        return return_val
-
-    if default:
-        return [default]
-
-    return []
+class Filter(TypedDict):
+    op: str
+    col: str
+    val: Union[str, List[str]]

Review comment:
       are you okay with Union[None, Any, List[Any]]




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



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

Reply via email to