From 26f47227d2ff7d77df7d5b5615b7b9a74c6423e1 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 18 May 2022 08:45:10 -0400 Subject: [PATCH] Fix `.ib` pattern match --- piker/brokers/ib.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/piker/brokers/ib.py b/piker/brokers/ib.py index cd3bd8ab..5f81a158 100644 --- a/piker/brokers/ib.py +++ b/piker/brokers/ib.py @@ -520,7 +520,7 @@ class Client: # XXX UPDATE: we can probably do the tick/trades scraping # inside our eventkit handler instead to bypass this entirely? - if 'ib' in pattern: + if '.ib' in pattern: from ..data._source import unpack_fqsn broker, symbol, expiry = unpack_fqsn(pattern) else: @@ -536,11 +536,7 @@ class Client: symbol, _, expiry = symbol.rpartition('.') # use heuristics to figure out contract "type" - try: - sym, exch = symbol.upper().rsplit('.', maxsplit=1) - except ValueError: - # likely there's an embedded `.` for a forex pair - breakpoint() + sym, exch = symbol.upper().rsplit('.', maxsplit=1) qualify: bool = True