-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MATLAB] Implement the isequal()
method on arrow.array.Array
#37391
Comments
take |
kevingurney
pushed a commit
that referenced
this issue
Aug 30, 2023
…rray` (#37446) ### Rationale for this change Currently, it's not possible to determine if two `arrow.array.Array` instances are equal because the `isequal()` method always returns `false` by default: **Example** ```matlab >> a = arrow.array([1 2 3]) a = [ 1, 2, 3 ] % Compare a with itself. >> tf = isequal(a, a) tf = logical 0 ```` ### What changes are included in this PR? 1. Defined an `isequal()` overload on the `arrow.array.Array` super-class. 2. Added a new method called `isEqual()` on the `arrow::matlab::array::proxy::Array` class. Two arrays are considered equal in the MATLAB Interface if the following conditions are met: 1. They have the same type 2. They have the same length 3. The same elements are valid 4. Corresponding valid elements are equal. **NOTE:** NaN values are not considered equal. **Example** ```matlab >> a = arrow.array([1 2 3]) a = [ 1, 2, 3 ] % Compare a with itself. >> tf = isequal(a, a) tf = logical 1 ``` ### Are these changes tested? Yes. Added positive and negative `isequal` tests for all concrete subclasses of `arrow.array.Array`. ### Are there any user-facing changes? Yes. Users can now use `isequal()` with `arrow.array.Array` subclasses. ### Future Directions 1. Implement [`isequaln`](https://www.mathworks.com/help/matlab/ref/isequaln.html) so that users can test array equality with NaNs being treated as equal. * Closes: #37391 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
loicalleyne
pushed a commit
to loicalleyne/arrow
that referenced
this issue
Nov 13, 2023
…rray.Array` (apache#37446) ### Rationale for this change Currently, it's not possible to determine if two `arrow.array.Array` instances are equal because the `isequal()` method always returns `false` by default: **Example** ```matlab >> a = arrow.array([1 2 3]) a = [ 1, 2, 3 ] % Compare a with itself. >> tf = isequal(a, a) tf = logical 0 ```` ### What changes are included in this PR? 1. Defined an `isequal()` overload on the `arrow.array.Array` super-class. 2. Added a new method called `isEqual()` on the `arrow::matlab::array::proxy::Array` class. Two arrays are considered equal in the MATLAB Interface if the following conditions are met: 1. They have the same type 2. They have the same length 3. The same elements are valid 4. Corresponding valid elements are equal. **NOTE:** NaN values are not considered equal. **Example** ```matlab >> a = arrow.array([1 2 3]) a = [ 1, 2, 3 ] % Compare a with itself. >> tf = isequal(a, a) tf = logical 1 ``` ### Are these changes tested? Yes. Added positive and negative `isequal` tests for all concrete subclasses of `arrow.array.Array`. ### Are there any user-facing changes? Yes. Users can now use `isequal()` with `arrow.array.Array` subclasses. ### Future Directions 1. Implement [`isequaln`](https://www.mathworks.com/help/matlab/ref/isequaln.html) so that users can test array equality with NaNs being treated as equal. * Closes: apache#37391 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
dgreiss
pushed a commit
to dgreiss/arrow
that referenced
this issue
Feb 19, 2024
…rray.Array` (apache#37446) ### Rationale for this change Currently, it's not possible to determine if two `arrow.array.Array` instances are equal because the `isequal()` method always returns `false` by default: **Example** ```matlab >> a = arrow.array([1 2 3]) a = [ 1, 2, 3 ] % Compare a with itself. >> tf = isequal(a, a) tf = logical 0 ```` ### What changes are included in this PR? 1. Defined an `isequal()` overload on the `arrow.array.Array` super-class. 2. Added a new method called `isEqual()` on the `arrow::matlab::array::proxy::Array` class. Two arrays are considered equal in the MATLAB Interface if the following conditions are met: 1. They have the same type 2. They have the same length 3. The same elements are valid 4. Corresponding valid elements are equal. **NOTE:** NaN values are not considered equal. **Example** ```matlab >> a = arrow.array([1 2 3]) a = [ 1, 2, 3 ] % Compare a with itself. >> tf = isequal(a, a) tf = logical 1 ``` ### Are these changes tested? Yes. Added positive and negative `isequal` tests for all concrete subclasses of `arrow.array.Array`. ### Are there any user-facing changes? Yes. Users can now use `isequal()` with `arrow.array.Array` subclasses. ### Future Directions 1. Implement [`isequaln`](https://www.mathworks.com/help/matlab/ref/isequaln.html) so that users can test array equality with NaNs being treated as equal. * Closes: apache#37391 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the enhancement requested
Currently, it's not possible to determine if two
arrow.array.Array
instances are equal because theisequal()
method always returnsfalse
by default:Example
Component(s)
MATLAB
The text was updated successfully, but these errors were encountered: