Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/fastavro/_read_common.py: 90%

10 statements  

« prev     ^ index     » next       coverage.py v7.2.2, created at 2023-03-26 06:10 +0000

1VERSION = 1 

2MAGIC = b"Obj" + chr(VERSION).encode() 

3SYNC_SIZE = 16 

4HEADER_SCHEMA = { 

5 "type": "record", 

6 "name": "org.apache.avro.file.Header", 

7 "fields": [ 

8 { 

9 "name": "magic", 

10 "type": {"type": "fixed", "name": "magic", "size": len(MAGIC)}, 

11 }, 

12 {"name": "meta", "type": {"type": "map", "values": "bytes"}}, 

13 {"name": "sync", "type": {"type": "fixed", "name": "sync", "size": SYNC_SIZE}}, 

14 ], 

15} 

16 

17 

18class SchemaResolutionError(Exception): 

19 pass 

20 

21 

22def missing_codec_lib(codec, library): 

23 def missing(fo): 

24 raise ValueError( 

25 f"{codec} codec is supported but you need to install {library}" 

26 ) 

27 

28 return missing