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.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/python/process_queue.py b/python/process_queue.py
index a4f52382..eac48fff 100644
--- a/python/process_queue.py
+++ b/python/process_queue.py
@@ -137,11 +137,9 @@ def terminate_list(
dest = get_filepath(base_dir, (trade_type, "A"), fund)
buf = StringIO()
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
- )
+ headers = get_headers("termination", fund)
+ csvwriter.writerow(headers)
+ csvwriter.writerows([trade.get(h) for h in headers] for trade in terms)
buf = buf.getvalue().encode()
upload_buf(buf, dest.name, fund, trade_type)
dest.parent.mkdir(exist_ok=True)