diff options
Diffstat (limited to 'python/task_server')
| -rw-r--r-- | python/task_server/globeop.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/python/task_server/globeop.py b/python/task_server/globeop.py index 39199186..ab5aa277 100644 --- a/python/task_server/globeop.py +++ b/python/task_server/globeop.py @@ -128,7 +128,7 @@ def download_data(engine, workdate: datetime.date, fund="SERCGMAST"): elif "Valuation" in filename: newfilename = f"Valuation_Report_{fund}.csv" else: - newfilename = "CDS_Report.xls" + newfilename = f"CDS_Report.xls" with (reports_dir / filename).open("rb") as fh: creds = json.load((Path.home() / ".credentials" / "gpg-key.json").open()) dec = gpg.decrypt_file( @@ -157,12 +157,14 @@ def insert_todb(engine, workdate: datetime.date, fund="SERCGMAST"): for report in ("Valuation", "Pnl", "CDS"): fun = getattr(load_globeop_report, f"read_{report.lower()}_report") table = f"{report.lower()}_reports" - report_file = reports_dir / f"{report}_Report_{fund}.csv" + report_file = reports_dir / ( + f"{report}_Report_{fund}.csv" if report != "CDS" else "CDS_Report.csv" + ) alias_names = { "SERCGMAST": ("SERCGMAST", "SERCGLTD", "SERCGLLC", "SER_TEST"), "BOWDST": ("BOWDST",), } - if not report_file.exists(): + if not report_file.exists() or (report == "CDS" and fund == "BOWDST"): continue df = fun(report_file) if report == "Valuation": @@ -182,6 +184,8 @@ def insert_todb(engine, workdate: datetime.date, fund="SERCGMAST"): alias_names[fund], ), ) + if report in ("CDS"): + breakpoint() df.to_sql(table, conn, if_exists="append", index=False) |
