aboutsummaryrefslogtreecommitdiffstats
path: root/python/markit_red.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/markit_red.py')
-rw-r--r--python/markit_red.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/python/markit_red.py b/python/markit_red.py
index 290a45cd..831ba90b 100644
--- a/python/markit_red.py
+++ b/python/markit_red.py
@@ -6,7 +6,7 @@ import shutil
import zipfile
from pathlib import Path
from lxml import etree
-from db import with_connection, dbengine
+from db import serenitas_engine
import pandas as pd
def request_payload(payload):
@@ -37,8 +37,7 @@ def download_report(report):
else:
yield request_payload(payload)
-@with_connection('serenitasdb')
-def update_redcodes(conn, fname):
+def update_redcodes(fname):
with open(os.path.join(os.environ['BASE_DIR'], "Tranche_data", "RED_reports", fname)) as fh:
et = etree.parse(fh)
data_version = []
@@ -56,7 +55,6 @@ def update_redcodes(conn, fname):
df_version['activeversion'] = df_version['activeversion'].map({'Y': True, None: False})
df_maturity.tenor = df_maturity['tenor'].map(lambda s: s.lower() + 'r')
df_maturity.coupon = (pd.to_numeric(df_maturity.coupon) * 10000).astype(int)
- serenitas_engine = dbengine('serenitasdb')
df_version.to_sql("index_version_markit", serenitas_engine, index=False, if_exists='append')
df_maturity.to_sql("index_maturity_markit", serenitas_engine, index=False, if_exists='append')