Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…apache#37256) ### Rationale for this change The original motivation for adding the super-class `arrow.type.TemporalType` in apache#37236 was to define a common implementation for extracting the `Unit` property from `TimestampType`, `Time32Type`, `Time64Type`, `Date32Type`, and `Date64Type`. However, this approach doesn't work because the `Unit` property on `Date32Type` and `Date64Type` is a `DateUnit`, while the `Unit` property on the other three types is a`TimeUnit`. As a result, we cannot define a shared method for extracting the `Unit` property in `TemporalType`. Instead, we plan on making `arrow.type.TemporalType` a "tag"-class (i.e. it has no properties or methods) so it can be used to group the "temporal" types together to ease authoring conditional logical in client code. In a future PR, we plan on adding functions like `arrow.type.isTemporal`, `arrow.type.isNumeric`, etc. so that clients don't need to query the class type information directly (i.e. call `isa(type, "arrow.type.TemporalType")`). ```matlab function doStuff(arrowArray) import arrow.* arrowType = arrowArray.Type; if type.isTemporal(arrowType) ... else if type.isNumeric(arrowType) ... else ... end end ``` ### What changes are included in this PR? 1. Removed the `TimeUnit` property from `arrow.type.TemporalType` 2. Added `TimeUnit` back as a property on `arrow.type.TimestampType` and `arrow.type.Time32Type` ### Are these changes tested? Yes, the existing tests cover these changes. ### Are there any user-facing changes? No. ### Future Directions 1. apache#37232 2. apache#37229 3. apache#37230 * Closes: apache#37251 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
- Loading branch information