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

[MATLAB] Add Type property to arrow.array.Array class #36251

Closed
sgilmore10 opened this issue Jun 22, 2023 · 1 comment · Fixed by #36270
Closed

[MATLAB] Add Type property to arrow.array.Array class #36251

sgilmore10 opened this issue Jun 22, 2023 · 1 comment · Fixed by #36270

Comments

@sgilmore10
Copy link
Member

Describe the enhancement requested

Now that we've the initial version of the arrow.type.Type class hierarchy, we should add a Type property to the arrow.array.Array base class.

Component(s)

MATLAB

@sgilmore10
Copy link
Member Author

take

kou pushed a commit that referenced this issue Jun 23, 2023
### Rationale for this change

Now that we've added the `arrow.type.Type` class hierarchy to the interface, we should add a property named `Type` to the base `arrow.array.Array` class.

### What changes are included in this PR?

All concrete subclasses of the `arrow.array.Array` define a property named `Type`:

```matlab
>> a = arrow.array.Float64Array([1 2 3 4])

a = 

[
  1,
  2,
  3,
  4
]
>> a.Type

ans = 

  Float64Type with properties:

            ID: Float64
      BitWidth: 64
     NumFields: 0
    NumBuffers: 2
```

### Are these changes tested?
Yes, we added test cases in `hNumeric.m` and `tBooleanArray.m`.

### Are there any user-facing changes?

Yes.

### Note

1. I noticed that the `tInt16Array.m` test class did not define the `NullSubstitutionValue` property. This meant the test class was abstract, so its tests were not running. That was my mistake. We'll think about ways to verify all the appropriate tests are running in CI.
2. As @ kou mentioned, we think it may be worth creating "Type" C++ proxy classes, especially when we start implementing nested array types. For now, we'll leave them as MATLAB-only classes, but will probably change their implementation soon. 
3. Thank you to @ kevingurney for the help!
* Closes: #36251

Authored-by: Sarah Gilmore <sgilmore@mathworks.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
@kou kou added this to the 13.0.0 milestone Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants