clesaec commented on code in PR #1759:
URL: https://github.com/apache/avro/pull/1759#discussion_r920060990
##########
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:
Sorry, i didn't see you were in case of existing duplicates symbols `if
len(set(symbols)) < len(symbols):`, so else part can't be for 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]