Skip to content

Commit

Permalink
Use f-string in helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Dec 16, 2020
1 parent 8057439 commit 29e27eb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions superset/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,5 @@ def get_time_filter_status( # pylint: disable=too-many-branches


def format_list(items: Sequence[str], sep: str = ", ", quote: str = '"') -> str:
items = [
"".join((quote, item.replace(quote, "\\" + quote), quote)) for item in items
]
return sep.join(items)
quote_escaped = "\\" + quote
return sep.join(f"{quote}{x.replace(quote, quote_escaped)}{quote}" for x in items)

0 comments on commit 29e27eb

Please sign in to comment.