ktmud commented on a change in pull request #12049:
URL:
https://github.com/apache/incubator-superset/pull/12049#discussion_r543766325
##########
File path: superset/utils/core.py
##########
@@ -1669,3 +1669,10 @@ def get_time_filter_status( # pylint:
disable=too-many-branches
)
return applied, rejected
+
+
+def format_list(items: Sequence[str], sep: str = ", ", quote: str = '"') ->
str:
+ items = [
+ "".join((quote, item.replace(quote, "\\" + quote), quote)) for item in
items
Review comment:
Nit: can probably use a formatted string instead of join here to make it
easier to read.
```python
def format_list(items: Sequence[str], sep: str = ", ", quote: str = '"') ->
str:
return sep.join(f'{quote}{x.replace(quote, "\\" + quote)}{quote}' for x
in items)
```
----------------------------------------------------------------
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]