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

Function expected_integer_value

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

Source from the content-addressed store, hash-verified

982])
983def test_sequence_time_with_timezone(time_type, unit, int_type):
984 def expected_integer_value(t):
985 # only use with utc time object because it doesn't adjust with the
986 # offset
987 units = ['s', 'ms', 'us', 'ns']
988 multiplier = 10**(units.index(unit) * 3)
989 if t is None:
990 return None
991 seconds = (
992 t.hour * 3600 +
993 t.minute * 60 +
994 t.second +
995 t.microsecond * 10**-6
996 )
997 return int(seconds * multiplier)
998
999 def expected_time_value(t):
1000 # 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