You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "sgilmore10 (via GitHub)" <gi...@apache.org> on 2023/08/18 20:17:55 UTC
[GitHub] [arrow] sgilmore10 opened a new pull request, #37256: GH-37251: [MATLAB] Make `arrow.type.TemporalType` a "tag" class
sgilmore10 opened a new pull request, #37256:
URL: https://github.com/apache/arrow/pull/37256
<!--
Thanks for opening a pull request!
If this is your first pull request you can find detailed information on how
to contribute here:
* [New Contributor's Guide](https://arrow.apache.org/docs/dev/developers/guide/step_by_step/pr_lifecycle.html#reviews-and-merge-of-the-pull-request)
* [Contributing Overview](https://arrow.apache.org/docs/dev/developers/overview.html)
If this is not a [minor PR](https://github.com/apache/arrow/blob/main/CONTRIBUTING.md#Minor-Fixes). Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose
Opening GitHub issues ahead of time contributes to the [Openness](http://theapacheway.com/open/#:~:text=Openness%20allows%20new%20users%20the,must%20happen%20in%20the%20open.) of the Apache Arrow project.
Then could you also rename the pull request title in the following format?
GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
or
MINOR: [${COMPONENT}] ${SUMMARY}
In the case of PARQUET issues on JIRA the title also supports:
PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
-->
### Rationale for this change
The original motivation for adding the super-class `arrow.type.TemporalType` in #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. #37232
2. #37229
3. #37230
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] kevingurney commented on pull request #37256: GH-37251: [MATLAB] Make `arrow.type.TemporalType` a "tag" class
Posted by "kevingurney (via GitHub)" <gi...@apache.org>.
kevingurney commented on PR #37256:
URL: https://github.com/apache/arrow/pull/37256#issuecomment-1686528901
+1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] github-actions[bot] commented on pull request #37256: GH-37251: [MATLAB] Make `arrow.type.TemporalType` a "tag" class
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37256:
URL: https://github.com/apache/arrow/pull/37256#issuecomment-1684394509
:warning: GitHub issue #37251 **has been automatically assigned in GitHub** to PR creator.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] sgilmore10 commented on pull request #37256: GH-37251: [MATLAB] Make `arrow.type.TemporalType` a "tag" class
Posted by "sgilmore10 (via GitHub)" <gi...@apache.org>.
sgilmore10 commented on PR #37256:
URL: https://github.com/apache/arrow/pull/37256#issuecomment-1685042261
> +1
>
> FYI: There is `TimeType` between `Time{32,64}Type` and `TemporalType` in C++:
>
> https://github.com/apache/arrow/blob/6c660a5d5cd5ae5cf41a6a211517ed98911885e3/cpp/src/arrow/type.h#L1333-L1381
That's a good point. We should add an `arrow.type.TimeType` class to reduce code duplication between `arrow.type.Time32Type` and `arrow.type.Time64Type`. I've created an issue (#37262) capturing this enhancement.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] kevingurney merged pull request #37256: GH-37251: [MATLAB] Make `arrow.type.TemporalType` a "tag" class
Posted by "kevingurney (via GitHub)" <gi...@apache.org>.
kevingurney merged PR #37256:
URL: https://github.com/apache/arrow/pull/37256
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] conbench-apache-arrow[bot] commented on pull request #37256: GH-37251: [MATLAB] Make `arrow.type.TemporalType` a "tag" class
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #37256:
URL: https://github.com/apache/arrow/pull/37256#issuecomment-1687171032
After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit 06b0e4f7db15c4ee88bf31a9238aa28bbf858081.
There were no benchmark performance regressions. 🎉
The [full Conbench report](https://github.com/apache/arrow/runs/16085832158) has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org