aboutsummaryrefslogtreecommitdiffstats
path: root/python/bbg_prices.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/bbg_prices.py')
-rw-r--r--python/bbg_prices.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/python/bbg_prices.py b/python/bbg_prices.py
index b9b92f6e..34991611 100644
--- a/python/bbg_prices.py
+++ b/python/bbg_prices.py
@@ -26,12 +26,13 @@ df['ID_BB_UNIQUE'] = cusips['id_bb_unique']
df.reset_index(inplace=True)
to_insert = df[['DEFAULTED', 'DEFAULT_DATE', 'CALLED', 'CALLED_DT', 'LN_ISSUE_STATUS', 'ID_BB_UNIQUE']]
to_insert = to_insert.where(to_insert.notnull(), None)
+
conn = engine.raw_connection()
with conn.cursor() as c:
c.executemany("UPDATE bloomberg_corp_ref SET defaulted = %(DEFAULTED)s, " \
"default_date = %(DEFAULT_DATE)s, called= %(CALLED)s, called_date = %(CALLED_DT)s, " \
"status = %(LN_ISSUE_STATUS)s WHERE id_bb_unique=%(ID_BB_UNIQUE)s",
- df.to_dict('records'))
+ to_insert.to_dict('records'))
conn.commit()
currentdata = pd.read_sql_query("SELECT id_bb_unique, pricingdate from bloomberg_corp",