paleolimbot commented on code in PR #175:
URL: https://github.com/apache/arrow-nanoarrow/pull/175#discussion_r1152046950


##########
src/nanoarrow/array.c:
##########
@@ -458,17 +467,38 @@ ArrowErrorCode ArrowArrayFinishBuilding(struct 
ArrowArray* array,
     return result;
   }
 
+  if (validation_level == NANOARROW_VALIDATION_LEVEL_MINIMAL) {
+    ArrowArrayViewReset(&array_view);
+    return NANOARROW_OK;
+  }
+
   result = ArrowArrayViewSetArray(&array_view, array, error);
   if (result != NANOARROW_OK) {
     ArrowArrayViewReset(&array_view);
     return result;
   }
 
   result = ArrowArrayCheckInternalBufferSizes(array, &array_view, 0, error);
+  if (result != NANOARROW_OK) {
+    ArrowArrayViewReset(&array_view);
+    return result;
+  }
+
+  if (validation_level == NANOARROW_VALIDATION_LEVEL_DEFAULT) {
+    ArrowArrayViewReset(&array_view);
+    return NANOARROW_OK;
+  }
+
+  result = ArrowArrayViewValidateFull(&array_view, error);

Review Comment:
   I added a bit to the group documentation for arrays...I don't think freeing 
the array in that method is a good idea because no other ArrowArrayXXX 
functions do this either. If surfacing this to a higher level runtime (e.g., 
Python), the error message could theoretically be used to fix the error and try 
again, too.



-- 
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: github-unsubscr...@arrow.apache.org

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

Reply via email to