diff options
Diffstat (limited to 'python/process_queue.py')
| -rw-r--r-- | python/process_queue.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/python/process_queue.py b/python/process_queue.py index b24d12bb..d18c15db 100644 --- a/python/process_queue.py +++ b/python/process_queue.py @@ -352,7 +352,9 @@ def process_list( if fund in ("SERCGMAST", "BOWDST") or trade_type in ("cds", "swaption"): try: buf = generate_csv( - (t for t in trades if t.get("upload", True)), trade_type, fund, + (t for t in trades if t.get("upload", True)), + trade_type, + fund, ) except IOError: pass @@ -383,7 +385,7 @@ def terminate_list( else: dest = get_filepath(base_dir, trade_type, termination["fund"]) if upload: - upload_buf(buf, dest.name) + upload_buf(buf, dest.name, termination["fund"]) dest.parent.mkdir(exist_ok=True) dest.write_bytes(buf) p.delete(key) @@ -908,7 +910,7 @@ def upload_buf(buf: bytes, dest: str, fund: str = "SERCGMAST") -> None: attach=(FileAttachment(name=dest, content=buf),), ) else: - raise ValueError("unknow fund name") + raise ValueError(f"unknow fund name: {fund}") def email_subject(trade): @@ -943,7 +945,7 @@ def build_termination( fund: str = "SERCGMAST", **kwargs, ) -> (bytes, Tuple[str, str]): - """ if termination_amount is None, assume full termination + """if termination_amount is None, assume full termination if termination_cp is None assume termination, otherwise assignment """ if dealid.startswith("SWPTN"): |
