villebro commented on a change in pull request #9523: Make email parsing more
robust
URL:
https://github.com/apache/incubator-superset/pull/9523#discussion_r408411708
##########
File path: superset/utils/core.py
##########
@@ -779,14 +780,7 @@ def send_MIME_email(e_from, e_to, mime_msg, config,
dryrun=False):
def get_email_address_list(address_string: str) -> List[str]:
address_string_list: List[str] = []
if isinstance(address_string, str):
- if "," in address_string:
- address_string_list = address_string.split(",")
- elif "\n" in address_string:
- address_string_list = address_string.split("\n")
- elif ";" in address_string:
- address_string_list = address_string.split(";")
- else:
- address_string_list = [address_string]
+ address_string_list = re.split(",|\n|\t| |;", address_string)
Review comment:
how about replacing `|\t| |` with `|\s|`?
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]