diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/mtm_status.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/python/mtm_status.py b/python/mtm_status.py index e5521f6d..92240b19 100644 --- a/python/mtm_status.py +++ b/python/mtm_status.py @@ -19,7 +19,7 @@ def run(conn, date): with ZipFile(sftp_handle).open(target_file.removesuffix(".zip")) as zip_handle: df = pd.read_csv(zip_handle, skiprows=2, na_filter=False) - df = df[(df["SwapType"] == "NEW") & (df["Executed"])] + df = df[(df["SwapType"].isin(["NEW", "ASGM", "TERM"])) & (df["Executed"])] place_holders = ",".join(["%s"] * 7) sql_str = f"INSERT INTO mtm_submissions VALUES({place_holders})" @@ -46,8 +46,14 @@ def run(conn, date): _product_type = {"CDISW": "swaptions", "TRN": "cds"} sql_str = f"UPDATE {_product_type[row.ProductType]} SET cpty_id = %s WHERE dealid = %s" if (row.SwapType == "NEW") and (row.BrokerId != "BNPBNY") and cpty_id: - c.execute(sql_str, (cpty_id, row.TicketNo)) - conn.commit() + c.execute( + sql_str, + ( + cpty_id, + row.TicketNo, + ), + ) + conn.commit() if __name__ == "__main__": |
