Skip to content

Commit

Permalink
Fix Arrow Instrument decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Dec 10, 2023
1 parent 37c328e commit 5908615
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,13 @@ def deserialize(batch: pa.RecordBatch) -> list[Instrument]:
b"FuturesContract": FuturesContract,
b"OptionsContract": OptionsContract,
}[ins_type]

maps = batch.to_pylist()
for m in maps:
if "info" in m:
m["info"] = msgspec.json.decode(m["info"])
info = m.get("info")
if info is not None:
m["info"] = msgspec.json.decode(info)
else:
m["info"] = None

return [Cls.from_dict(data) for data in maps]

0 comments on commit 5908615

Please sign in to comment.