AlenkaF opened a new pull request, #55811: URL: https://github.com/apache/arrow/pull/55811
### Rationale for this change `month_day_nano_interval` is supported by PyArrow but other interval types are missing (`day_time_interval` and `month_interval`). ### What changes are included in this PR? The changes made by Joris in https://github.com/jorisvandenbossche/arrow/commit/97a09537146e83a295580768295ea6d2fcd10240: * `month_interval()` and `day_time_interval()` factories * `pa.types.is_interval` for all three interval types * array and scalar classes * API docs updates Picking up where Joris has left off I added: * `as_py()` on both scalar classes, * doctrings on the types constructors. Current decisions: * `MonthIntervalScalar.as_py()` returns `int` (number of months) * `DayTimeIntervalScalar.as_py()` returns plain tuple (days, milliseconds) with the raw values. A possible follow-up (or a change in this PR if preferred) would be a named tuple, e.g. pa.`DayTime(days, milliseconds)`. Planned follow-ups: * `pa.scalar`, `pa.array` from Python values * `to_numpy()`, `to_pandas()`: returning object dtype with the `as_py()` values (or timedelta64[M] for months) ### Are these changes tested? Yes. ### Are there any user-facing changes? No. ### Was AI used for this PR? **PR code and description written by:** - [X] Human - [ ] AI **Reviewed before submission by:** - [ ] Human - [X] AI - [ ] Not reviewed * GitHub Issue: (filled in automatically from the PR title) -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
