aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/import_quotes.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/python/import_quotes.py b/python/import_quotes.py
index bd1a2735..7cf8fe7b 100644
--- a/python/import_quotes.py
+++ b/python/import_quotes.py
@@ -34,7 +34,7 @@ def get_markit_bbg_mapping(database, basketid_list, workdate):
doc_clause_mapping = DOC_CLAUSE_MAPPING14
else:
doc_clause_mapping = DOC_CLAUSE_MAPPING
- markit_bbg_mapping = defaultdict(list)
+ markit_bbg_mapping = defaultdict(set)
all_tickers = set([])
with database.cursor() as c:
c.execute("SELECT markit_ticker, markit_tier, spread, currency, cds_curve, " \
@@ -46,7 +46,11 @@ def get_markit_bbg_mapping(database, basketid_list, workdate):
doc_clause_mapping[line['doc_clause']], float(line['spread'])/10000)
if key==('CESEOP', 'SNRFOR', 'USD', 'XR14', 0.05):
key=('CESEOP', 'SNRFOR', 'USD', 'XR', 0.05)
- markit_bbg_mapping[key].append(line['cds_curve'])
+ ## each markit ticker can be mapped to multiple bbg tickers
+ ## these bbg tickers can have different curves (ok)
+ ## or same curves (not ok since date, curve_ticker needs to be unique)
+ ## therefore we keep them in a set strucutre
+ markit_bbg_mapping[key].add(tuple(line['cds_curve']))
database.commit()
return (all_tickers, markit_bbg_mapping)