zgramana commented on a change in pull request #7032:
URL: https://github.com/apache/arrow/pull/7032#discussion_r418422210



##########
File path: csharp/src/Apache.Arrow/Arrays/BooleanArray.cs
##########
@@ -153,17 +184,25 @@ private void CheckIndex(int index)
                 new[] { nullBitmapBuffer, valueBuffer }))
         { }
 
-        public BooleanArray(ArrayData data) 
+        public BooleanArray(ArrayData data)
             : base(data)
         {
             data.EnsureDataType(ArrowTypeId.Boolean);
         }
 
         public override void Accept(IArrowArrayVisitor visitor) => 
Accept(this, visitor);
 
+        [Obsolete("GetBoolean does not support null values. Use GetValue 
instead (which this method invokes internally).")]
         public bool GetBoolean(int index)
         {
-            return BitUtility.GetBit(Values, index);
+            return GetValue(index).GetValueOrDefault();

Review comment:
       Changed in the test code uses of `GetValueOrDefault` to `Value`, but 
think this one should remain `GetValueOrDefault`. Existing code is likely to 
break otherwise. I've seen it already with the tests. Current code written 
against `GetBoolean` will not be expecting an exception, and it's easy enough 
for a null to get introduced somewhere else that eventually causes `GetBoolean` 
throw.




----------------------------------------------------------------
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:
[email protected]


Reply via email to