From e9e76e0626b3e478dcf2b53f476d54f754a50897 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 19 Mar 2022 13:47:25 -0400 Subject: [PATCH] Support no venue or suffix symbols (normally crypto$) --- piker/data/_source.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/piker/data/_source.py b/piker/data/_source.py index 9774ca3c..7146026e 100644 --- a/piker/data/_source.py +++ b/piker/data/_source.py @@ -97,9 +97,21 @@ def uncons_fqsn(fqsn: str) -> tuple[str, str, str]: Unpack a fully-qualified-symbol-name to ``tuple``. ''' + venue = '' + suffix = '' + # TODO: probably reverse the order of all this XD tokens = fqsn.split('.') - if len(tokens) > 3: + if len(tokens) < 3: + # probably crypto + symbol, broker = tokens + return ( + broker, + symbol, + '', + ) + + elif len(tokens) > 3: symbol, venue, suffix, broker = tokens else: symbol, venue, broker = tokens