anekdoti commented on a change in pull request #1623:
URL: https://github.com/apache/avro/pull/1623#discussion_r835808865



##########
File path: lang/csharp/src/apache/main/Util/TimeMicrosecond.cs
##########
@@ -50,17 +51,16 @@ public override object ConvertToBaseValue(object 
logicalValue, LogicalSchema sch
         {
             var time = (TimeSpan)logicalValue;
 
-            if (time > _maxTime)
+            if (time >= _maxTime)
                 throw new ArgumentOutOfRangeException(nameof(logicalValue), "A 
'time-micros' value can only have the range '00:00:00' to '23:59:59'.");

Review comment:
       In regards to the exception message: I am not sure that it is correct 
enough because it is directly in contradiction to the resolution offered by the 
logical type. I understand the worry about users string matching the exception 
message - but should such a approach be encouraged? Maybe it's better to 
continue to improve exception messages and just make it explicit in the release 
notes. If you decide to change the message, another way could be to just write 
the lower bound as 00:00:00:000000 and the inclusive upper bound as 
23:59:59:999999.
   
   For the lower bound - you are right, I also saw this but got interrupted. I 
think it should be fine to throw an exception when the base value is < 0 - at 
least the Avro 1.11.0 specification is clear about the lower bound that 
implicitly excludes values < 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]


Reply via email to