MCPcopy Create free account
hub / github.com/apache/arrow / test_iso_calendar_longer_array

Function test_iso_calendar_longer_array

python/pyarrow/tests/test_compute.py:2745–2754  ·  view source on GitHub ↗
(unit)

Source from the content-addressed store, hash-verified

2743
2744@pytest.mark.parametrize("unit", ["s", "ms", "us", "ns"])
2745def 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

Callers

nothing calls this directly

Calls 3

datetimeMethod · 0.80
equalsMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected