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

Function expected_integer_value

python/pyarrow/tests/test_convert_builtin.py:961–974  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

959])
960def test_sequence_time_with_timezone(time_type, unit, int_type):
961 def expected_integer_value(t):
962 # only use with utc time object because it doesn't adjust with the
963 # offset
964 units = ['s', 'ms', 'us', 'ns']
965 multiplier = 10**(units.index(unit) * 3)
966 if t is None:
967 return None
968 seconds = (
969 t.hour * 3600 +
970 t.minute * 60 +
971 t.second +
972 t.microsecond * 10**-6
973 )
974 return int(seconds * multiplier)
975
976 def expected_time_value(t):
977 # only use with utc time object because it doesn't adjust with the

Callers

nothing calls this directly

Calls 2

indexMethod · 0.45
DecimalMethod · 0.45

Tested by

no test coverage detected