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

Function test_date64_from_builtin_datetime

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

Source from the content-addressed store, hash-verified

2241
2242
2243def test_date64_from_builtin_datetime():
2244 val1 = datetime.datetime(2000, 1, 1, 12, 34, 56, 123456)
2245 val2 = datetime.datetime(2000, 1, 1)
2246 result = pa.array([val1, val2], type='date64')
2247 result2 = pa.array([val1.date(), val2.date()], type='date64')
2248
2249 assert result.equals(result2)
2250
2251 as_i8 = result.view('int64')
2252 assert as_i8[0].as_py() == as_i8[1].as_py()
2253
2254
2255def test_create_date32_and_date64_arrays_with_mask():

Callers

nothing calls this directly

Calls 6

datetimeMethod · 0.80
equalsMethod · 0.80
as_pyMethod · 0.80
arrayMethod · 0.45
dateMethod · 0.45
viewMethod · 0.45

Tested by

no test coverage detected