File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ def extract(chunks: Iterable[JsonDict]) -> Iterable[JsonDict]:
4141 if isinstance (chunk , dict ):
4242 yield chunk
4343 yield from extract (chunk .values ())
44+ elif isinstance (chunk , list ):
45+ yield from extract (chunk ) #type: ignore[unreachable] #TODO: is this actually unreachable, or are our types wrong?
4446
4547 yield from extract ([chunk .data for chunk in chunks ])
4648
@@ -90,6 +92,8 @@ def compress(chunk: JsonDict) -> JsonDict:
9092
9193 def helper (chunk : JsonDict ) -> JsonDict :
9294 nonlocal counter
95+ if not isinstance (chunk , dict ):
96+ return chunk #type: ignore[unreachable] #TODO: is this actually unreachable, or are our types wrong?
9397
9498 if len (chunk ) <= 2 :
9599 return chunk
@@ -119,6 +123,8 @@ def decompress(chunk: JsonDict) -> JsonDict:
119123 cache : dict [int , JsonDict ] = {}
120124
121125 def helper (chunk : JsonDict ) -> JsonDict :
126+ if not isinstance (chunk , dict ):
127+ return chunk #type: ignore[unreachable] #TODO: is this actually unreachable, or are our types wrong?
122128 if ".id" in chunk :
123129 return cache [chunk [".id" ]]
124130
You can’t perform that action at this time.
0 commit comments