Commits


sgilmore10 authored and GitHub committed 602083be4f9
GH-37472: [MATLAB] Implement the `isequal()` method on `arrow.type.Type` (#37474) ### Rationale for this change Currently, it's not possible to determine if two `arrow.type.Type` instances are equal because the `isequal()` method always returns `false` by default: ```matlab >> t = arrow.int32() t = Int32Type with properties: ID: Int32 % Compare a with itself >> tf = isequal(t, t) tf = logical 0 ``` ### What changes are included in this PR? 1. Implemented the `isequal` method on all concrete subclasses of `arrow.type.Type` 2. Added a new method called `isEqual()` on the `arrow::matlab::type::proxy::Type` class. **Example Usage** ```matlab >> t1 = arrow.timestamp(TimeUnit="Second"); >> t2 = arrow.timestamp(TimeUnit="Microsecond"); >> t3 = arrow.timestamp(TimeUnit="Second"); % Compare t1 and t2 >> tf1 = isequal(t1, t2) tf1 = logical 0 % Compare t1 and t3 >> tf2 = isequal(t1, t3) tf2 = logical 1 ``` ### Are these changes tested? Yes. Added test cases verifying `isequal` behaves as expected for all concrete subclasses of `arrow.type.Type`. ### Are there any user-facing changes? Yes. Users can now use the `isequal` method to compare `arrow.type.Type` instances for equality. ### Future Directions 1. Implement the `isequal` method for `arrow.type.Field` 2. Implement the `isequal` method for `arrow.tabular.Schema` * Closes: #37472 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>