aboutsummaryrefslogtreecommitdiffstats
path: root/python/trade_dataclasses.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/trade_dataclasses.py')
-rw-r--r--python/trade_dataclasses.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/python/trade_dataclasses.py b/python/trade_dataclasses.py
index ce7a519c..9d174782 100644
--- a/python/trade_dataclasses.py
+++ b/python/trade_dataclasses.py
@@ -273,9 +273,7 @@ class BondDeal(Deal, table_name="bonds"):
self.description = line["Security"].removesuffix(" Mtge")
self.buysell = line["Side"] == "B"
self.bbg_ticket_id = line["bbg_ticket_id"]
-
- def insert_bbg_line(self, line: dict):
- bond_ticket_columns = ",".join(c for c in line.keys())
- bond_place_holders = ",".join(["%s"] * len(line.keys()))
- self._bbg_sql_insert = f"INSERT INTO bond_tickets({bond_ticket_columns}) VALUES({bond_place_holders})"
- self._bbg_insert_queue.append(line.values())
+ bbg_tickets = [self.bbg_ticket_id, *line.values()]
+ place_holders = ",".join(["%s"] * len(bbg_tickets))
+ self._bbg_sql_insert = f"INSERT INTO bond_tickets VALUES({place_holders})"
+ self._bbg_insert_queue.append(bbg_tickets)