-
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
GH-38418: [MATLAB] Add method for extracting one row of an arrow.tabular.Table
as a string
#38463
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
containing an array whose type is not supported
kevingurney
requested changes
Oct 25, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @sgilmore10!
github-actions
bot
added
awaiting changes
Awaiting changes
and removed
awaiting review
Awaiting review
labels
Oct 25, 2023
Co-authored-by: Kevin Gurney <[email protected]>
Co-authored-by: Kevin Gurney <[email protected]>
github-actions
bot
added
awaiting change review
Awaiting change review
and removed
awaiting changes
Awaiting changes
labels
Oct 25, 2023
kevingurney
requested changes
Oct 26, 2023
github-actions
bot
added
awaiting changes
Awaiting changes
and removed
awaiting change review
Awaiting change review
labels
Oct 26, 2023
github-actions
bot
added
awaiting change review
Awaiting change review
and removed
awaiting changes
Awaiting changes
labels
Oct 26, 2023
kevingurney
approved these changes
Oct 26, 2023
+1 |
github-actions
bot
added
awaiting merge
Awaiting merge
and removed
awaiting change review
Awaiting change review
labels
Oct 26, 2023
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 818f71d. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
loicalleyne
pushed a commit
to loicalleyne/arrow
that referenced
this pull request
Nov 13, 2023
…ow.tabular.Table` as a string (apache#38463) ### Rationale for this change We would like to modify the display of the `arrow.tabular.Table` and `arrow.tabular.RecordBatch` classes to be more "MATLAB-like". In order to do this, we need to add a method to their respective C++ Proxy classes that returns a single row of the Table/RecordBatch as a MATLAB `string` array. ### What changes are included in this PR? Added new function template: ```cpp template <typename TabularLike> arrow::matlab::tabular::print_row(const std::shared_ptr<TabularLike>& tabularObject, const int64_t row_index) ``` This function template returns a string representation of the specified row in `tabbularObject`. Added a new proxy method called `getRowString` to both the `Table` and `RecordBatch` C++ proxy classes. These methods invoke `print_row` to return a string representation of one row in the `Table`/`RecordBatch`. Neither MATLAB class `arrow.tabular.Table` nor `arrow.tabular.RecordBatch` expose these methods directly because they will only be used internally for display. Below is an example Output of `getRowString()`: ```matlab >> matlabTable = table([1; 2; 3], ["ABC"; "DE"; "FGH"], datetime(2023, 10, 25) + days(0:2)'); >> arrowTable = arrow.table(matlabTable); >> rowOneAsString = arrowTable.Proxy.getRowString(struct(Index=int64(1))) rowOneAsString = "1 | "ABC" | 2023-10-25 00:00:00.000000" ``` ### Are these changes tested? Yes, added a new test class called `tTabularInternal.m`. Because `getRowString()` is not a method on the MATLAB classes `arrow.tabular.Table` and `arrow.tabular.RecordBatch`, this test class calls `getRowString()` on their `Proxy` properties, which are public but hidden. ### Are there any user-facing changes? No. * Closes: apache#38418 Lead-authored-by: Sarah Gilmore <[email protected]> Co-authored-by: sgilmore10 <[email protected]> Co-authored-by: Kevin Gurney <[email protected]> Signed-off-by: Kevin Gurney <[email protected]>
dgreiss
pushed a commit
to dgreiss/arrow
that referenced
this pull request
Feb 19, 2024
…ow.tabular.Table` as a string (apache#38463) ### Rationale for this change We would like to modify the display of the `arrow.tabular.Table` and `arrow.tabular.RecordBatch` classes to be more "MATLAB-like". In order to do this, we need to add a method to their respective C++ Proxy classes that returns a single row of the Table/RecordBatch as a MATLAB `string` array. ### What changes are included in this PR? Added new function template: ```cpp template <typename TabularLike> arrow::matlab::tabular::print_row(const std::shared_ptr<TabularLike>& tabularObject, const int64_t row_index) ``` This function template returns a string representation of the specified row in `tabbularObject`. Added a new proxy method called `getRowString` to both the `Table` and `RecordBatch` C++ proxy classes. These methods invoke `print_row` to return a string representation of one row in the `Table`/`RecordBatch`. Neither MATLAB class `arrow.tabular.Table` nor `arrow.tabular.RecordBatch` expose these methods directly because they will only be used internally for display. Below is an example Output of `getRowString()`: ```matlab >> matlabTable = table([1; 2; 3], ["ABC"; "DE"; "FGH"], datetime(2023, 10, 25) + days(0:2)'); >> arrowTable = arrow.table(matlabTable); >> rowOneAsString = arrowTable.Proxy.getRowString(struct(Index=int64(1))) rowOneAsString = "1 | "ABC" | 2023-10-25 00:00:00.000000" ``` ### Are these changes tested? Yes, added a new test class called `tTabularInternal.m`. Because `getRowString()` is not a method on the MATLAB classes `arrow.tabular.Table` and `arrow.tabular.RecordBatch`, this test class calls `getRowString()` on their `Proxy` properties, which are public but hidden. ### Are there any user-facing changes? No. * Closes: apache#38418 Lead-authored-by: Sarah Gilmore <[email protected]> Co-authored-by: sgilmore10 <[email protected]> Co-authored-by: Kevin Gurney <[email protected]> Signed-off-by: Kevin Gurney <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale for this change
We would like to modify the display of the
arrow.tabular.Table
andarrow.tabular.RecordBatch
classes to be more "MATLAB-like". In order to do this, we need to add a method to their respective C++ Proxy classes that returns a single row of the Table/RecordBatch as a MATLABstring
array.What changes are included in this PR?
Added new function template:
This function template returns a string representation of the specified row in
tabbularObject
.Added a new proxy method called
getRowString
to both theTable
andRecordBatch
C++ proxy classes. These methods invokeprint_row
to return a string representation of one row in theTable
/RecordBatch
. Neither MATLAB classarrow.tabular.Table
norarrow.tabular.RecordBatch
expose these methods directly because they will only be used internally for display.Below is an example Output of
getRowString()
:Are these changes tested?
Yes, added a new test class called
tTabularInternal.m
. BecausegetRowString()
is not a method on the MATLAB classesarrow.tabular.Table
andarrow.tabular.RecordBatch
, this test class callsgetRowString()
on theirProxy
properties, which are public but hidden.Are there any user-facing changes?
No.
arrow.tabular.Table
as a string #38418