| 2743 | |
| 2744 | @pytest.mark.parametrize("unit", ["s", "ms", "us", "ns"]) |
| 2745 | def test_iso_calendar_longer_array(unit): |
| 2746 | # https://github.com/apache/arrow/issues/38655 |
| 2747 | # ensure correct result for array length > 32 |
| 2748 | arr = pa.array([datetime.datetime(2022, 1, 2, 9)]*50, pa.timestamp(unit)) |
| 2749 | result = pc.iso_calendar(arr) |
| 2750 | expected = pa.StructArray.from_arrays( |
| 2751 | [[2021]*50, [52]*50, [7]*50], |
| 2752 | names=['iso_year', 'iso_week', 'iso_day_of_week'] |
| 2753 | ) |
| 2754 | assert result.equals(expected) |
| 2755 | |
| 2756 | |
| 2757 | @pytest.mark.pandas |