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

Function test_time32_time64_from_integer

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

Source from the content-addressed store, hash-verified

2558
2559
2560def test_time32_time64_from_integer():
2561 # ARROW-4111
2562 result = pa.array([1, 2, None], type=pa.time32('s'))
2563 expected = pa.array([datetime.time(second=1),
2564 datetime.time(second=2), None],
2565 type=pa.time32('s'))
2566 assert result.equals(expected)
2567
2568 result = pa.array([1, 2, None], type=pa.time32('ms'))
2569 expected = pa.array([datetime.time(microsecond=1000),
2570 datetime.time(microsecond=2000), None],
2571 type=pa.time32('ms'))
2572 assert result.equals(expected)
2573
2574 result = pa.array([1, 2, None], type=pa.time64('us'))
2575 expected = pa.array([datetime.time(microsecond=1),
2576 datetime.time(microsecond=2), None],
2577 type=pa.time64('us'))
2578 assert result.equals(expected)
2579
2580 result = pa.array([1000, 2000, None], type=pa.time64('ns'))
2581 expected = pa.array([datetime.time(microsecond=1),
2582 datetime.time(microsecond=2), None],
2583 type=pa.time64('ns'))
2584 assert result.equals(expected)
2585
2586
2587@pytest.mark.numpy

Callers

nothing calls this directly

Calls 3

timeMethod · 0.80
equalsMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected