From a9778e40017c3bd568ba3177356c1a9ff226c18f Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 21 Mar 2023 21:58:40 -0400 Subject: [PATCH] Always cast `Order.symbol: str` for now To make nested `msgspec.Struct`s work we need to tell the codec that the `.symbol` is some struct def, since we don't really need to enforce that (yet) we're just going to enc/dec as `str` until we further formalize and/or need something more complex. --- piker/clearing/_messages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/piker/clearing/_messages.py b/piker/clearing/_messages.py index 0d97ee3f..61579787 100644 --- a/piker/clearing/_messages.py +++ b/piker/clearing/_messages.py @@ -29,7 +29,6 @@ from typing import ( from msgspec import field -from ..accounting._mktinfo import Symbol from ..data.types import Struct @@ -94,7 +93,8 @@ class Order(Struct): # internal ``emdsd`` unique "order id" oid: str # uuid4 - symbol: str | Symbol + # TODO: figure out how to optionally typecast this to `MktPair`? + symbol: str # | MktPair account: str # should we set a default as '' ? price: float