aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/intex/load_intex_collateral.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/python/intex/load_intex_collateral.py b/python/intex/load_intex_collateral.py
index 9fdfa9d6..e43a58b1 100644
--- a/python/intex/load_intex_collateral.py
+++ b/python/intex/load_intex_collateral.py
@@ -78,6 +78,8 @@ def upload_data(conn, workdate):
)
basedir = Path(os.environ["DATA_DIR"]) / ("Collaterals_" + workdate)
for fname in basedir.iterdir():
+ if fname.stem.endswith("zip"):
+ continue
fh = open(fname, encoding="windows-1252")
dealname = fname.name.rsplit("_", 1)[0].lower()
dr = csv.DictReader(fh, dialect="excel-tab")
@@ -101,7 +103,7 @@ def upload_data(conn, workdate):
for key, l in [("LoanX ID", 8), ("CUSIP", 9), ("Asset Subtype", 10)]:
if line[key]:
if len(line[key]) > l:
- logger.warning("dubious {0} found: {1}".format(key, line[key]))
+ logger.warning(f"dubious {key} found: {line[key]}")
line[key] = line[key][:l]
if (
@@ -184,10 +186,8 @@ def upload_data(conn, workdate):
conn.commit()
if currlen != len(data): # then we delete and just reupload
logger.warning(
- "{0} has {1} rows in the database "
- "and current collateral file has {2}".format(
- dealname, currlen, len(data)
- )
+ f"{dealname} has {currlen} rows in the database "
+ f"and current collateral file has {len(data)}"
)
with conn.cursor() as c:
sql_str = "DELETE FROM et_collateral where dealname = %s and updatedate = %s"