zhaoyongjie commented on a change in pull request #18998:
URL: https://github.com/apache/superset/pull/18998#discussion_r818397409
##########
File path: superset/utils/core.py
##########
@@ -1097,11 +1107,9 @@ def merge_extra_form_data(form_data: Dict[str, Any]) ->
None:
{"isExtra": True, **fltr} for fltr in append_adhoc_filters # type:
ignore
)
if append_filters:
- adhoc_filters.extend(
- simple_filter_to_adhoc({"isExtra": True, **fltr}) # type: ignore
- for fltr in append_filters
- if fltr
- )
+ for key, value in form_data.items():
+ if re.match("adhoc_filter.*", key):
+ append_filters_to_adhoc_filters(value, append_filters)
Review comment:
To make this logic seem more straightforward(Which iteme are we going to
update), I suggest this:
```suggestion
append_filters.extend(form_data.get('adhoc_filter', []))
append_filters.extend(form_data.get('adhoc_filters', []))
append_filters = [simple_filter_to_adhoc({"isExtra": True, **f}) for f in
append_filters if f]
```
--
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]