aboutsummaryrefslogtreecommitdiffstats
path: root/python/process_queue.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/process_queue.py')
-rw-r--r--python/process_queue.py9
1 files changed, 6 insertions, 3 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)