-
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] Rename Length
property on arrow.array.Array
and arrow.array.ChunkedArray
to NumElements
#38164
Comments
take |
arrow.array.Array
Length
property to NumElements
Length
property on arrow.array.Array
and arrow.array.ChunkedArray
to NumElements
kevingurney
pushed a commit
that referenced
this issue
Oct 11, 2023
…d `arrow.array.ChunkedArray` to `NumElements` (#38190) ### Rationale for this change We would like to rename the `Length` property on `arrow.array.Array` (and `arrow.array.ChunkedArray`) to `NumElements` because MATLAB has a function called `length(A)`, which returns the length of the largest array dimension in `A`. Because `arrow.array.Array` inherits from `matlab.mixin.Scalar`, it's size is always `1x1`, so the `length()` function always returns `1`. This may confuse users because the `Length` property of `arrow.array.Array` returns the number of elements within the array, which may not be `1`. ```matlab >> array = arrow.array([1 2 3 4 5]); % The length property returns the number of elements in the array >> array.Length ans = int64 5 % The length method returns the length of the largest dimension >> length(array) ans = 1 ``` I suspect this inconsistency will confuse users, so we should rename the `Length` property to `NumElements`. ### What changes are included in this PR? 1. Renamed `Length` property on `arrow.array.Array` to `NumElements` 2. Renamed `Length` property on `arrow.array.ChunkedArray` to `NumElements` ### Are these changes tested? Yes. I modified the existing `Length` test cases to now test the `NumElements` property. ### Are there any user-facing changes? Yes. Please note this is a breaking change because `Length` is no longer a property on either `arrow.array.Array` or `arrow.array.ChunkedArray`. However, we have not yet cut an initial release of the MATLAB interface, so we don't expect this change should affect too many users at this point. * Closes: #38164 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
JerAguilon
pushed a commit
to JerAguilon/arrow
that referenced
this issue
Oct 23, 2023
…ay` and `arrow.array.ChunkedArray` to `NumElements` (apache#38190) ### Rationale for this change We would like to rename the `Length` property on `arrow.array.Array` (and `arrow.array.ChunkedArray`) to `NumElements` because MATLAB has a function called `length(A)`, which returns the length of the largest array dimension in `A`. Because `arrow.array.Array` inherits from `matlab.mixin.Scalar`, it's size is always `1x1`, so the `length()` function always returns `1`. This may confuse users because the `Length` property of `arrow.array.Array` returns the number of elements within the array, which may not be `1`. ```matlab >> array = arrow.array([1 2 3 4 5]); % The length property returns the number of elements in the array >> array.Length ans = int64 5 % The length method returns the length of the largest dimension >> length(array) ans = 1 ``` I suspect this inconsistency will confuse users, so we should rename the `Length` property to `NumElements`. ### What changes are included in this PR? 1. Renamed `Length` property on `arrow.array.Array` to `NumElements` 2. Renamed `Length` property on `arrow.array.ChunkedArray` to `NumElements` ### Are these changes tested? Yes. I modified the existing `Length` test cases to now test the `NumElements` property. ### Are there any user-facing changes? Yes. Please note this is a breaking change because `Length` is no longer a property on either `arrow.array.Array` or `arrow.array.ChunkedArray`. However, we have not yet cut an initial release of the MATLAB interface, so we don't expect this change should affect too many users at this point. * Closes: apache#38164 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
…ay` and `arrow.array.ChunkedArray` to `NumElements` (apache#38190) ### Rationale for this change We would like to rename the `Length` property on `arrow.array.Array` (and `arrow.array.ChunkedArray`) to `NumElements` because MATLAB has a function called `length(A)`, which returns the length of the largest array dimension in `A`. Because `arrow.array.Array` inherits from `matlab.mixin.Scalar`, it's size is always `1x1`, so the `length()` function always returns `1`. This may confuse users because the `Length` property of `arrow.array.Array` returns the number of elements within the array, which may not be `1`. ```matlab >> array = arrow.array([1 2 3 4 5]); % The length property returns the number of elements in the array >> array.Length ans = int64 5 % The length method returns the length of the largest dimension >> length(array) ans = 1 ``` I suspect this inconsistency will confuse users, so we should rename the `Length` property to `NumElements`. ### What changes are included in this PR? 1. Renamed `Length` property on `arrow.array.Array` to `NumElements` 2. Renamed `Length` property on `arrow.array.ChunkedArray` to `NumElements` ### Are these changes tested? Yes. I modified the existing `Length` test cases to now test the `NumElements` property. ### Are there any user-facing changes? Yes. Please note this is a breaking change because `Length` is no longer a property on either `arrow.array.Array` or `arrow.array.ChunkedArray`. However, we have not yet cut an initial release of the MATLAB interface, so we don't expect this change should affect too many users at this point. * Closes: apache#38164 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
…ay` and `arrow.array.ChunkedArray` to `NumElements` (apache#38190) ### Rationale for this change We would like to rename the `Length` property on `arrow.array.Array` (and `arrow.array.ChunkedArray`) to `NumElements` because MATLAB has a function called `length(A)`, which returns the length of the largest array dimension in `A`. Because `arrow.array.Array` inherits from `matlab.mixin.Scalar`, it's size is always `1x1`, so the `length()` function always returns `1`. This may confuse users because the `Length` property of `arrow.array.Array` returns the number of elements within the array, which may not be `1`. ```matlab >> array = arrow.array([1 2 3 4 5]); % The length property returns the number of elements in the array >> array.Length ans = int64 5 % The length method returns the length of the largest dimension >> length(array) ans = 1 ``` I suspect this inconsistency will confuse users, so we should rename the `Length` property to `NumElements`. ### What changes are included in this PR? 1. Renamed `Length` property on `arrow.array.Array` to `NumElements` 2. Renamed `Length` property on `arrow.array.ChunkedArray` to `NumElements` ### Are these changes tested? Yes. I modified the existing `Length` test cases to now test the `NumElements` property. ### Are there any user-facing changes? Yes. Please note this is a breaking change because `Length` is no longer a property on either `arrow.array.Array` or `arrow.array.ChunkedArray`. However, we have not yet cut an initial release of the MATLAB interface, so we don't expect this change should affect too many users at this point. * Closes: apache#38164 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
We would like to rename the
Length
property ofarrow.array.Array
toNumElements
because MATLAB has a function calledlength(A)
, which returns the length of the largest array dimension inA
.Because
arrow.array.Array
inherits frommatlab.mixin.Scalar
, it's size is always1x1
, so thelength()
function always returns1
. This may confuse users because theLength
property ofarrow.array.Array
returns the number of elements within the array, which may not be1
.I suspect this inconsistency will confuse users, so we should rename the
Length
property toNumElements
.Component(s)
MATLAB
The text was updated successfully, but these errors were encountered: