Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/fastavro/const.py: 100%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1import datetime
3MCS_PER_SECOND = 1000000
4MCS_PER_MINUTE = MCS_PER_SECOND * 60
5MCS_PER_HOUR = MCS_PER_MINUTE * 60
7MLS_PER_SECOND = 1000
8MLS_PER_MINUTE = MLS_PER_SECOND * 60
9MLS_PER_HOUR = MLS_PER_MINUTE * 60
11# A date logical type annotates an Avro int, where the int stores the number
12# of days from the unix epoch, 1 January 1970 (ISO calendar).
13DAYS_SHIFT = datetime.date(1970, 1, 1).toordinal()
15# Validation has these as common checks
16INT_MIN_VALUE = -(1 << 31)
17INT_MAX_VALUE = (1 << 31) - 1
18LONG_MIN_VALUE = -(1 << 63)
19LONG_MAX_VALUE = (1 << 63) - 1
21NAMED_TYPES = {"record", "enum", "fixed", "error"}
22AVRO_TYPES = {
23 "boolean",
24 "bytes",
25 "double",
26 "float",
27 "int",
28 "long",
29 "null",
30 "string",
31 "fixed",
32 "enum",
33 "record",
34 "error",
35 "array",
36 "map",
37 "union",
38 "request",
39 "error_union",
40}