aboutsummaryrefslogtreecommitdiffstats
path: root/python/book_bbg.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/book_bbg.py')
-rw-r--r--python/book_bbg.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/python/book_bbg.py b/python/book_bbg.py
index b41c763b..85e16d9d 100644
--- a/python/book_bbg.py
+++ b/python/book_bbg.py
@@ -51,7 +51,7 @@ class Bbg:
except (ValueError, UnboundLocalError) as e:
logger.warning(f"problem with file {f.filename}")
logger.warning(e)
- pass
+ continue
else:
cls._cache[bbg_id] = None
Bbg[ticket_type].commit(trade)
@@ -86,6 +86,11 @@ class Bbg:
@classmethod
def process(cls, reader, bbg_id):
for row in reader:
+ for k, v in row.items():
+ if v == "":
+ row[k] = None
+ if row.get("Block Status") != "Accepted":
+ raise ValueError("Rejected trade")
line = {"bbg_ticket_id": bbg_id, **row}
orig_row = line.copy()
for trade in cls.trade_class(row).from_bbg_line(line):