Skip to content
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-38166: [MATLAB] Improve tabular object display #38482

Merged
merged 14 commits into from
Oct 27, 2023

Conversation

sgilmore10
Copy link
Member

@sgilmore10 sgilmore10 commented Oct 26, 2023

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

>> 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

>> 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

@github-actions
Copy link

⚠️ GitHub issue #38166 has been automatically assigned in GitHub to PR creator.

@kou kou changed the title GH-38166: [MATLAB] [MATLAB] Improve tabular object display GH-38166: [MATLAB] Improve tabular object display Oct 27, 2023
Copy link
Member

@kevingurney kevingurney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! This is a great improvement! Thank you!

@kevingurney
Copy link
Member

+1

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting review Awaiting review labels Oct 27, 2023
@kevingurney kevingurney merged commit 547b240 into apache:main Oct 27, 2023
10 checks passed
@kevingurney kevingurney deleted the GH-38166 branch October 27, 2023 15:01
@kevingurney kevingurney removed the awaiting merge Awaiting merge label Oct 27, 2023
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 547b240.

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
### 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: apache#38166

Authored-by: Sarah Gilmore <[email protected]>
Signed-off-by: Kevin Gurney <[email protected]>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
### 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: apache#38166

Authored-by: Sarah Gilmore <[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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MATLAB] Improve tabular object display
2 participants