aboutsummaryrefslogtreecommitdiffstats
path: root/python/markit_tranche_quotes.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/markit_tranche_quotes.py')
-rw-r--r--python/markit_tranche_quotes.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/python/markit_tranche_quotes.py b/python/markit_tranche_quotes.py
index b4fc8da6..b42b555b 100644
--- a/python/markit_tranche_quotes.py
+++ b/python/markit_tranche_quotes.py
@@ -36,7 +36,7 @@ sql_str = f"""INSERT INTO tranche_quotes(quotedate, index, series, version, teno
def get_latest_quote_id(db):
with db.cursor() as c:
c.execute("SELECT max(markit_id) FROM tranche_quotes")
- markit_id, = c.fetchone()
+ (markit_id,) = c.fetchone()
return markit_id
@@ -93,7 +93,10 @@ for d in csv.DictReader(f, fieldnames=headers):
for k in ["Bid", "Mid", "Ask"]:
# d[f'upfront{k}'] = d[f'spread{k}']
if d["series"] < 19:
- running = runningdict2[d["attachment"]]
+ try:
+ running = runningdict2[d["attachment"]]
+ except KeyError:
+ continue
elif d["series"] < 25:
running = runningdict1[d["attachment"]]
else: