You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Rationale for this change
As a follow up to apache#38531 (see apache#38531 (comment)), 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`.
* GitHub Issue: apache#38532
Lead-authored-by: Sarah Gilmore <74676073+sgilmore10@users.noreply.github.com>
Co-authored-by: Sarah Gilmore <sgilmore@mathworks.com>
Co-authored-by: Kevin Gurney <kevin.p.gurney@gmail.com>
Signed-off-by: Sarah Gilmore <sgilmore@mathworks.com>
0 commit comments