diff options
| -rw-r--r-- | python/upload_bbh_trades.py | 15 | ||||
| -rw-r--r-- | scripts/baml_cash.timer | 2 | ||||
| -rw-r--r-- | scripts/bowdst.timer | 2 | ||||
| -rw-r--r-- | scripts/strategy_cash_realloc.timer | 2 |
4 files changed, 15 insertions, 6 deletions
diff --git a/python/upload_bbh_trades.py b/python/upload_bbh_trades.py index d827e3ee..2f9fa0b8 100644 --- a/python/upload_bbh_trades.py +++ b/python/upload_bbh_trades.py @@ -56,9 +56,18 @@ if __name__ == "__main__": ], ) try: - df.to_sql( - "bbh_bond_upload", dawn_engine, index=False, if_exists="append" - ) + try: + df.to_sql( + "bbh_bond_upload", dawn_engine, index=False, if_exists="append" + ) + except IntegrityError: + conn.rollback() + df["Client Reference Number"] = df["Client Reference Number"] + "-U" + df = pd.read_sql_query( + "SELECT * FROM bbh_bond_upload where tradeid=%s", + dawn_engine, + params=(obj["tradeid"],), + ) except IntegrityError: conn.rollback() else: diff --git a/scripts/baml_cash.timer b/scripts/baml_cash.timer index 3f1a091a..88136a1a 100644 --- a/scripts/baml_cash.timer +++ b/scripts/baml_cash.timer @@ -2,7 +2,7 @@ Description=Download and load cash balances for baml reporting [Timer] OnCalendar=Mon..Fri 7:30 -Unit=python_dir@baml.service +Unit=simple@baml.service RandomizedDelaySec=1m [Install] diff --git a/scripts/bowdst.timer b/scripts/bowdst.timer index 08af906d..80340e00 100644 --- a/scripts/bowdst.timer +++ b/scripts/bowdst.timer @@ -2,7 +2,7 @@ Description=Load Bowdst cash balances and email positions to HM [Timer] OnCalendar=Mon..Fri 7:30 -Unit=python_dir@bowdst.service +Unit=simple@bowdst.service RandomizedDelaySec=1m [Install] diff --git a/scripts/strategy_cash_realloc.timer b/scripts/strategy_cash_realloc.timer index fe39e95c..bd54b281 100644 --- a/scripts/strategy_cash_realloc.timer +++ b/scripts/strategy_cash_realloc.timer @@ -2,7 +2,7 @@ Description=Move cash between strategies in the bowdoin street fund [Timer] OnCalendar=Mon..Fri 11:30 -Unit=python_dir@strat_cash_realloc.service +Unit=simple@strat_cash_realloc.service RandomizedDelaySec=1m [Install] |
