aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/process_queue.py9
-rw-r--r--python/trade_dataclasses.py2
2 files changed, 7 insertions, 4 deletions
diff --git a/python/process_queue.py b/python/process_queue.py
index aacd9cf8..a4f52382 100644
--- a/python/process_queue.py
+++ b/python/process_queue.py
@@ -136,9 +136,12 @@ def terminate_list(
if upload and terms:
dest = get_filepath(base_dir, (trade_type, "A"), fund)
buf = StringIO()
- csvwriter = csv.DictWriter(buf, get_headers("termination", fund))
- csvwriter.writeheader()
- csvwriter.writerows(terms)
+ csvwriter = csv.writer(buf)
+ csvwriter.writerow(get_headers("termination", fund))
+ csvwriter.writerows(
+ [trade.get(h, None) for h in get_headers("termination", fund)]
+ for trade in terms
+ )
buf = buf.getvalue().encode()
upload_buf(buf, dest.name, fund, trade_type)
dest.parent.mkdir(exist_ok=True)
diff --git a/python/trade_dataclasses.py b/python/trade_dataclasses.py
index 27c59cc0..d7a1814f 100644
--- a/python/trade_dataclasses.py
+++ b/python/trade_dataclasses.py
@@ -641,7 +641,7 @@ class TerminationDeal(
deal_type: str = field(
init=False, metadata={"insert": False, "globeop": "DealType"}
)
- globeop_id: str = field(init=False, default=None, metadata={"globeop": "gtid"})
+ globeop_id: str = field(init=False, default=None, metadata={"globeop": "GoTradeId"})
def __post_init__(self):
if self.dealid.startswith("SWPTN"):