sgilmore10 opened a new pull request, #47059:
URL: https://github.com/apache/arrow/pull/47059

   
   ### Rationale for this change
   
   As a follow up to #38531 (see 
https://github.com/apache/arrow/pull/38531#discussion_r1377981403), we should 
consider adding a `validate` method to all `arrow.array.Array` classes, which 
would allow users to explicitly validate the contents of an `arrow.array.Array` 
after it is created.
   
   ### What changes are included in this PR?
   
   Added `validate()` as a method to `arrow.array.Array`. This method has one 
name-value pair which is called `ValidationMode`. `ValidationMode` can either 
be specified as `"minimal"` or `"full"`. By default, `ValidationMode="minimal"`.
   
   **Example Usage:**
   
   ```matlab
   >> offsets = arrow.array(int32([0 1 0]));
   >> values = arrow.array(1:3);
   >> array = arrow.array.ListArray.fromArrays(offsets, values);
   >> array.validate(ValidationMode="full")
   >> array.validate(ValidationMode="full")
   Error using .  (line 63)
   Offset invariant failure: non-monotonic offset at slot 2: 0 < 1
   
   Error in arrow.array.Array/validate (line 68)
                
obj.Proxy.validate(struct(ValidationMode=uint8(opts.ValidationMode)));
                
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   
   ```
   
   ### Are these changes tested?
   
   Yes. Added a MATLAB test class called `tValidateArray.m`.
   
   ### Are there any user-facing changes?
   
   Yes. There is a new public method that is accessible via any subclass of 
`arrow.array.Array`. 
   


-- 
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