You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/07/17 01:14:44 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #17057: Strip non-ascii characters in pod name on k8s executor

uranusjr commented on a change in pull request #17057:
URL: https://github.com/apache/airflow/pull/17057#discussion_r671586155



##########
File path: airflow/kubernetes/kubernetes_helper_functions.py
##########
@@ -37,7 +37,7 @@ def _strip_unsafe_kubernetes_special_chars(string: str) -> str:
     :param string: The requested Pod name
     :return: Pod name stripped of any unsafe characters
     """
-    return ''.join(ch.lower() for ch in list(string) if ch.isalnum())
+    return ''.join(ch.lower() for ch in list(string) if ch.isalnum()).encode('ascii', 'ignore').decode()

Review comment:
       ```suggestion
       return string.encode('ascii', 'ignore').decode().lower()
   ```
   
   I think this will be a bit more performant (less split and join happening)




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org