Commits


sgilmore10 authored and GitHub committed 547b2406d71
GH-38166: [MATLAB] Improve tabular object display (#38482) ### Rationale for this change Currently, the display for `arrow.tabular.RecordBatch` and `arrow.tabular.Table` are not very MATLAB-like. ### What changes are included in this PR? 1. Updated the display of both `arrow.tabular.Table` and `arrow.tabular.RecordBatch`. 2. Added a new utility function `arrow.internal.display.boldFontIfPossible` 3. Renamed `arrow.array.internal.display.pluralizeStringIfNeeded` to `arrow.internal.display.pluralizeStringIfNeeded` 4. Renamed `arrow.tabular.internal.displaySchema` to `arrow.tabular.internal.display.getSchemaString`. **Example RecordBatch Display** ```matlab >> t = table(1, false, datetime(2023, 1, 1), VariableNames=["Number", "Logical", "Date"]); >> rb = arrow.recordBatch(t) rb = Arrow RecordBatch with 1 row and 3 columns: Schema: Number: Float64 | Logical: Boolean | Date: Timestamp First Row: 1 | false | 2023-01-01 00:00:00.000000 ``` **Example Table Display** ```matlab >> t = table(1, false, datetime(2023, 1, 1), VariableNames=["Number", "Logical", "Date"]); >> arrowTable = arrow.table(t) arrowTable = Arrow Table with 1 row and 3 columns: Schema: Number: Float64 | Logical: Boolean | Date: Timestamp First Row: 1 | false | 2023-01-01 00:00:00.000000 ``` ### Are these changes tested? Yes, I added a new test class in `matlab/test/arrow/tabular` called `tTabularDisplay.m`. ### Are there any user-facing changes? Yes. Users will now see the new `Table`/`RecordBatch` display * Closes: #38166 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>