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

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

10 statements  

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, *libraries): 

23 def missing(fo): 

24 raise ValueError( 

25 f"{codec} codec is supported but you need to install one of the " 

26 + f"following libraries: {libraries}" 

27 ) 

28 

29 return missing