-
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] Add tests about time precision preservation when converting MATLAB duration to arrow time32 and time64 #38652
Comments
take |
leihou6116
added a commit
to mathworks/arrow
that referenced
this issue
Nov 9, 2023
kevingurney
pushed a commit
that referenced
this issue
Nov 16, 2023
…onverting MATLAB duration to `arrow.array.Time32Array` and `arrow.array.Time64Array` (#38661) ### Rationale for this change The current conversion from MATLAB duration to `arrow.array.Time32Array` and `arrow.array.Time64Array` loses time precision, and there is no test to cover such limitation. It is best practice to have tests cover software design. In addition, such tests will be helpful to evaluate the impact in the future when we improve the design. ### What changes are included in this PR? I mainly added three test cases for each of `arrow.array.Time32Array` and `arrow.array.Time64Array`. - Updated the basic test case to verify both class and value. In the MATLAB interface tests, we would like to verify the value to make sure there is no precision loss. The basic test case will serve as a test example when people learn to write tests. Updating the basic test case will set a good example for contributors to learn. - Test the default value of "TimeUnit". - Test the functionality of "TimeUnit". ### Are these changes tested? No software change. The updated test files passed on my local machine. ### Are there any user-facing changes? No * Closes: #38652 Authored-by: Lei Hou <leihou@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
dgreiss
pushed a commit
to dgreiss/arrow
that referenced
this issue
Feb 19, 2024
…when converting MATLAB duration to `arrow.array.Time32Array` and `arrow.array.Time64Array` (apache#38661) ### Rationale for this change The current conversion from MATLAB duration to `arrow.array.Time32Array` and `arrow.array.Time64Array` loses time precision, and there is no test to cover such limitation. It is best practice to have tests cover software design. In addition, such tests will be helpful to evaluate the impact in the future when we improve the design. ### What changes are included in this PR? I mainly added three test cases for each of `arrow.array.Time32Array` and `arrow.array.Time64Array`. - Updated the basic test case to verify both class and value. In the MATLAB interface tests, we would like to verify the value to make sure there is no precision loss. The basic test case will serve as a test example when people learn to write tests. Updating the basic test case will set a good example for contributors to learn. - Test the default value of "TimeUnit". - Test the functionality of "TimeUnit". ### Are these changes tested? No software change. The updated test files passed on my local machine. ### Are there any user-facing changes? No * Closes: apache#38652 Authored-by: Lei Hou <leihou@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
The current tests for MATLAB interface
arrow.array.Time32Array.fromMATLAB
andarrow.array.Time64Array.fromMATLAB
don't cover the preservation of time precision whenTimeUnit
is specified. The design might be changed in the future. If we add tests to cover the current behavior, the tests will be helpful to evaluate impact in the future.An example of current behavior:
Component(s)
MATLAB
The text was updated successfully, but these errors were encountered: