chamikaramj commented on a change in pull request #14502:
URL: https://github.com/apache/beam/pull/14502#discussion_r610957549



##########
File path: sdks/python/apache_beam/pipeline.py
##########
@@ -1416,10 +1418,15 @@ def get_or_assign(self, obj=None, obj_type=None, 
label=None):
 
     return self._obj_to_id[obj]
 
+  def _normalize(self, str_value):
+    str_value = unicodedata.normalize('NFC', str_value)
+    return re.sub(r'[^a-zA-Z0-9-_]+', '-', str_value)

Review comment:
       I'm not 100% sure what exactly to use here. NFC and NFD seems to be the 
two main options and NFC seems to be the shorter of the two so I chose that: 
https://docs.python.org/3.6/library/unicodedata.html#unicodedata.normalize
   Also, this will only apply to non-ASCII characters IIUC.




-- 
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]


Reply via email to