-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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] arrow.array.BooleanArray
's toMATLAB
method does not take slice offsets into account
#38630
Comments
take |
The same bug also manifests itself when accessing the Valid property on all sliced arrays. This is because both BooleanArray's toMATLAB method and the Valid getter function call arrow::matlab::bit::unpack(const std::shared_ptrarrow::Buffer& packed_buffer, int64_t length). This function calls VisitBitsUnrolled(const uint8_t* bitmap, int64_t start_offset, int64_t length, Visitor&& visit) with the assumption that start_offset is always 0. However, when the array has been sliced, start_offset will not be 0. Updating our unpack function to accept start_offset as input should fix both issues. |
…s not take slice offsets into account (#38636) ### Rationale for this change While working on #38415, I noticed that the `toMATLAB` method of `arrow.array.BooleanArray` does not take the slice offset into account. This will cause the `toMATLAB` method to return the wrong value. ### What changes are included in this PR? 1. Updated `arrow::matlab::bit::unpack` function to accept a `start_offset` as input. 2. Updated clients (`BooleanArray::toMATLAB` and `Array::getValid`) to supply the array `offset` as the `start_offset`. ### Are these changes tested? The existing tests cover these changes. Additionally, the changes for #38415 will include tests that verify the `toMATLAB` method returns the correct MATLAB array when the underlying Arrow array has been sliced. ### Are there any user-facing changes? No. * Closes: #38630 Authored-by: Sarah Gilmore <[email protected]> Signed-off-by: Kevin Gurney <[email protected]>
…od does not take slice offsets into account (apache#38636) ### Rationale for this change While working on apache#38415, I noticed that the `toMATLAB` method of `arrow.array.BooleanArray` does not take the slice offset into account. This will cause the `toMATLAB` method to return the wrong value. ### What changes are included in this PR? 1. Updated `arrow::matlab::bit::unpack` function to accept a `start_offset` as input. 2. Updated clients (`BooleanArray::toMATLAB` and `Array::getValid`) to supply the array `offset` as the `start_offset`. ### Are these changes tested? The existing tests cover these changes. Additionally, the changes for apache#38415 will include tests that verify the `toMATLAB` method returns the correct MATLAB array when the underlying Arrow array has been sliced. ### Are there any user-facing changes? No. * Closes: apache#38630 Authored-by: Sarah Gilmore <[email protected]> Signed-off-by: Kevin Gurney <[email protected]>
…od does not take slice offsets into account (apache#38636) ### Rationale for this change While working on apache#38415, I noticed that the `toMATLAB` method of `arrow.array.BooleanArray` does not take the slice offset into account. This will cause the `toMATLAB` method to return the wrong value. ### What changes are included in this PR? 1. Updated `arrow::matlab::bit::unpack` function to accept a `start_offset` as input. 2. Updated clients (`BooleanArray::toMATLAB` and `Array::getValid`) to supply the array `offset` as the `start_offset`. ### Are these changes tested? The existing tests cover these changes. Additionally, the changes for apache#38415 will include tests that verify the `toMATLAB` method returns the correct MATLAB array when the underlying Arrow array has been sliced. ### Are there any user-facing changes? No. * Closes: apache#38630 Authored-by: Sarah Gilmore <[email protected]> Signed-off-by: Kevin Gurney <[email protected]>
Describe the bug, including details regarding any error messages, version, and platform.
While working on #38415, I noticed that the
toMATLAB
method ofarrow.array.BooleanArray
does not take the slice offset into account. This will cause thetoMATLAB
method to return the wrong value.Component(s)
MATLAB
The text was updated successfully, but these errors were encountered: