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



##########
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:
       Even though this is Obsolete, I still think it should act appropriately. 
I think it should call `GetValue(index).Value`. If `null` is at `index` that 
will create an exception, which informs the developer they have a bug in their 
code. That is better than silently lying to them and returning `false`.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to