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.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/python/book_bbg.py b/python/book_bbg.py
index 45abe0d3..a0809d26 100644
--- a/python/book_bbg.py
+++ b/python/book_bbg.py
@@ -3,6 +3,9 @@ from trade_dataclasses import Deal, DealType, BbgDeal
from stat import S_ISREG
import re
import time
+import logging
+
+logger = logging.getLogger(__name__)
def get_bbg_id(s):
@@ -24,8 +27,13 @@ def run():
continue
if bbg_id not in BbgDeal._cache:
with sftp.client.open(f.filename) as fh:
- Deal[DealType(deal_type)].process(fh, bbg_id)
- BbgDeal._cache[bbg_id] = None
+ try:
+ Deal[DealType(deal_type)].process(fh, bbg_id)
+ except TypeError as e:
+ logger.warning(f"{bbg_id} missing cp in db")
+ pass
+ else:
+ BbgDeal._cache[bbg_id] = None
except OSError:
sftp.client.close()
sftp = SftpClient.from_creds("bbg")