puchengy commented on code in PR #83: URL: https://github.com/apache/iceberg-python/pull/83#discussion_r1365868994
########## pyiceberg/schema.py: ########## @@ -1273,6 +1273,102 @@ def primitive(self, primitive: PrimitiveType) -> PrimitiveType: return primitive +# Implementation copied from Apache Iceberg repo. +def make_compatible_name(name: str) -> str: + if not _valid_avro_name(name): + return _sanitize_name(name) + return name + + +def _valid_avro_name(name: str) -> bool: + length = len(name) + assert length > 0, "Empty name" Review Comment: I think we do not allow empty names, more importantly, I just copy this from Iceberg implementation so we don't bother to figure this out. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org