You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/04/09 22:10:19 UTC

[GitHub] [beam] TheNeuralBit commented on a change in pull request #14502: [BEAM-12145] Normalize and size-limit transform Ids - Python SDK

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



##########
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:
       TIL about [unicode normalization](https://en.wikipedia.org/wiki/Unicode_equivalence#Normalization). Just for my own edification, do you know why NFC is the right option here?




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