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

Function test_cast_date32_to_int

python/pyarrow/tests/test_array.py:2300–2313  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2298
2299
2300def test_cast_date32_to_int():
2301 arr = pa.array([0, 1, 2], type='i4')
2302
2303 result1 = arr.cast('date32')
2304 result2 = result1.cast('i4')
2305
2306 expected1 = pa.array([
2307 datetime.date(1970, 1, 1),
2308 datetime.date(1970, 1, 2),
2309 datetime.date(1970, 1, 3)
2310 ]).cast('date32')
2311
2312 assert result1.equals(expected1)
2313 assert result2.equals(arr)
2314
2315
2316@pytest.mark.numpy

Callers

nothing calls this directly

Calls 4

equalsMethod · 0.80
arrayMethod · 0.45
castMethod · 0.45
dateMethod · 0.45

Tested by

no test coverage detected