diff options
| -rw-r--r-- | python/process_queue.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/python/process_queue.py b/python/process_queue.py index a0b1ebce..88f7a087 100644 --- a/python/process_queue.py +++ b/python/process_queue.py @@ -299,7 +299,7 @@ def build_line(obj, trade_type="bond"): 'buy_amount': 'Buy Amount', 'spot_rate': 'Spot Rate'}) - return [obj.get(h, None) for h in HEADERS[queue_name]] + return [obj.get(h, None) for h in HEADERS[trade_type]] def get_bbg_data(conn, session, identifier, cusip=None, isin=None, @@ -457,7 +457,7 @@ def upload_file(file_path: pathlib.Path) -> None: def write_buffer(buf: bytes, base_dir: pathlib.Path, trade_type: str = "bond", fund: str = "SERCGMAST"): - file_path = get_filepath(base_dir, queue_name, fund) + file_path = get_filepath(base_dir, trade_type, fund) file_path.write_bytes(buf) return file_path @@ -490,11 +490,11 @@ if __name__ == "__main__": for trade_type in ['bond', 'cds', 'swaption', 'future', 'wire', 'spot', 'capfloor']: list_trades = get_trades(q, trade_type, args.fund) if list_trades: - if trade_type in ['bond', 'cd']: + if trade_type in ['bond', 'cds']: process_fun = globals()[f"{trade_type}_trade_process"] - with init_bbg_session(BBG_IP) as session: - for trade in list_trades: - process_fun(dawndb, session, trade) + with init_bbg_session(BBG_IP) as session: + for trade in list_trades: + process_fun(dawndb, session, trade) if trade_type == "bond" and args.fund == "SERCGMAST": for trade in list_trades: if trade["upload"]: |
