You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2022/07/13 07:49:21 UTC

[GitHub] [avro] clesaec commented on a diff in pull request #1759: AVRO-3573: Duplicate symbols (EnumSchema)

clesaec commented on code in PR #1759:
URL: https://github.com/apache/avro/pull/1759#discussion_r919760019


##########
lang/py/avro/schema.py:
##########
@@ -570,7 +570,12 @@ def __init__(
                     raise avro.errors.InvalidName("An enum symbol must be a valid schema name.")
 
         if len(set(symbols)) < len(symbols):
-            raise avro.errors.AvroException(f"Duplicate symbol: {symbols}")
+            duplicate_symbols = {symbol for symbol in symbols if symbols.count(symbol) > 1}
+
+            if len(duplicate_symbols) == 1:

Review Comment:
   What if there are 2 duplicate symbols ["A", "A", "B", "B"]
   shouldn't it be : 
   `if len(duplicate_symbols) > 0:`



-- 
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-unsubscribe@avro.apache.org

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