You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/12/15 23:38:09 UTC

[GitHub] [incubator-superset] ktmud commented on a change in pull request #12049: feat: show missing parameters in query

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org