-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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-37835: [MATLAB] Improve arrow.tabular.Schema
display
#37836
Conversation
4f26032
to
02304d9
Compare
I haven't looked at the code yet in detail, but just a thought - what if we made the display look similar to the following? Arrow tabular Schema with 3 fields:
┌─────────────────┬─────────────────┬──────────────┐
│ Name: A │ Name: B │ Name: C │
│ Type: Time32 │ Type: Boolean │ Type: String │
└─────────────────┴─────────────────┴──────────────┘
This is just a suggestion. Let me know what you think. |
I like this. It makes it clear this object is an Arrow |
I discussed this more with @sgilmore10, and we realized that the Unicode box-drawing characters don't align properly when certain Unicode characters are used. So, for now, we think it is best to go with a simpler display. |
Based on our discussion, I've updated the >> field1 = arrow.field("A", arrow.time32());
>> field2 = arrow.field("B", arrow.boolean());
>> s = arrow.schema([field1 field2])
s =
Arrow Schema with 2 fields:
A: Time32 | B: Boolean When in desktop mode, |
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.
Thank you for working on this, @sgilmore10! This is a great improvement to the display! Thank you for iterating on the design with me!
+1 |
After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit 00efb06. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them. |
…he#37836) ### Rationale for this change We would like to change how `arrow.tabular.Schema`s are displayed in the Command Window. Below is the current display: ```matlab >> field1 = arrow.field("A", arrow.time32()); >> field2 = arrow.field("B", arrow.boolean()); >>s = arrow.schema([field1 field2]) s = A: time32[s] B: bool ``` This display is not very MATLAB-like. ### What changes are included in this PR? 1. Updated the display of `arrow.tabular.Schema`. Below is the new display: ```matlab >> field1 = arrow.field("A", arrow.time32()); >> field2 = arrow.field("B", arrow.boolean()); >> s = arrow.schema([field1 field2]) s = Arrow Schema with 2 fields: A: Time32 | B: Boolean ``` When MATLAB is opened in desktop mode, `Schema`, `Time32`, and `Boolean` are hyperlinks users can click on to view the help text for the different class types. ### Are these changes tested? Yes. Added three new test cases to `tSchema.m`: 1. `TestDisplaySchemaZeroFields` 2. `TestDisplaySchemaOneField` 3. `TestDisplaySchemaMultipleFields` ### Are there any user-facing changes? Yes. `arrow.tabular.Schema`s will be displayed differently in the Command Window. ### Notes Once apache#37826 is merged, I will rebase my changes and mark this PR as ready for review. * Closes: apache#37835 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
…he#37836) ### Rationale for this change We would like to change how `arrow.tabular.Schema`s are displayed in the Command Window. Below is the current display: ```matlab >> field1 = arrow.field("A", arrow.time32()); >> field2 = arrow.field("B", arrow.boolean()); >>s = arrow.schema([field1 field2]) s = A: time32[s] B: bool ``` This display is not very MATLAB-like. ### What changes are included in this PR? 1. Updated the display of `arrow.tabular.Schema`. Below is the new display: ```matlab >> field1 = arrow.field("A", arrow.time32()); >> field2 = arrow.field("B", arrow.boolean()); >> s = arrow.schema([field1 field2]) s = Arrow Schema with 2 fields: A: Time32 | B: Boolean ``` When MATLAB is opened in desktop mode, `Schema`, `Time32`, and `Boolean` are hyperlinks users can click on to view the help text for the different class types. ### Are these changes tested? Yes. Added three new test cases to `tSchema.m`: 1. `TestDisplaySchemaZeroFields` 2. `TestDisplaySchemaOneField` 3. `TestDisplaySchemaMultipleFields` ### Are there any user-facing changes? Yes. `arrow.tabular.Schema`s will be displayed differently in the Command Window. ### Notes Once apache#37826 is merged, I will rebase my changes and mark this PR as ready for review. * Closes: apache#37835 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
…he#37836) ### Rationale for this change We would like to change how `arrow.tabular.Schema`s are displayed in the Command Window. Below is the current display: ```matlab >> field1 = arrow.field("A", arrow.time32()); >> field2 = arrow.field("B", arrow.boolean()); >>s = arrow.schema([field1 field2]) s = A: time32[s] B: bool ``` This display is not very MATLAB-like. ### What changes are included in this PR? 1. Updated the display of `arrow.tabular.Schema`. Below is the new display: ```matlab >> field1 = arrow.field("A", arrow.time32()); >> field2 = arrow.field("B", arrow.boolean()); >> s = arrow.schema([field1 field2]) s = Arrow Schema with 2 fields: A: Time32 | B: Boolean ``` When MATLAB is opened in desktop mode, `Schema`, `Time32`, and `Boolean` are hyperlinks users can click on to view the help text for the different class types. ### Are these changes tested? Yes. Added three new test cases to `tSchema.m`: 1. `TestDisplaySchemaZeroFields` 2. `TestDisplaySchemaOneField` 3. `TestDisplaySchemaMultipleFields` ### Are there any user-facing changes? Yes. `arrow.tabular.Schema`s will be displayed differently in the Command Window. ### Notes Once apache#37826 is merged, I will rebase my changes and mark this PR as ready for review. * Closes: apache#37835 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
…he#37836) ### Rationale for this change We would like to change how `arrow.tabular.Schema`s are displayed in the Command Window. Below is the current display: ```matlab >> field1 = arrow.field("A", arrow.time32()); >> field2 = arrow.field("B", arrow.boolean()); >>s = arrow.schema([field1 field2]) s = A: time32[s] B: bool ``` This display is not very MATLAB-like. ### What changes are included in this PR? 1. Updated the display of `arrow.tabular.Schema`. Below is the new display: ```matlab >> field1 = arrow.field("A", arrow.time32()); >> field2 = arrow.field("B", arrow.boolean()); >> s = arrow.schema([field1 field2]) s = Arrow Schema with 2 fields: A: Time32 | B: Boolean ``` When MATLAB is opened in desktop mode, `Schema`, `Time32`, and `Boolean` are hyperlinks users can click on to view the help text for the different class types. ### Are these changes tested? Yes. Added three new test cases to `tSchema.m`: 1. `TestDisplaySchemaZeroFields` 2. `TestDisplaySchemaOneField` 3. `TestDisplaySchemaMultipleFields` ### Are there any user-facing changes? Yes. `arrow.tabular.Schema`s will be displayed differently in the Command Window. ### Notes Once apache#37826 is merged, I will rebase my changes and mark this PR as ready for review. * Closes: apache#37835 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
Rationale for this change
We would like to change how
arrow.tabular.Schema
s are displayed in the Command Window. Below is the current display:This display is not very MATLAB-like.
What changes are included in this PR?
arrow.tabular.Schema
. Below is the new display:When MATLAB is opened in desktop mode,
Schema
,Time32
, andBoolean
are hyperlinks users can click on to view the help text for the different class types.Are these changes tested?
Yes. Added three new test cases to
tSchema.m
:TestDisplaySchemaZeroFields
TestDisplaySchemaOneField
TestDisplaySchemaMultipleFields
Are there any user-facing changes?
Yes.
arrow.tabular.Schema
s will be displayed differently in the Command Window.Notes
Once #37826 is merged, I will rebase my changes and mark this PR as ready for review.
arrow.tabular.Schema
display #37835