aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/bowdst.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/bowdst.py b/python/bowdst.py
index cea2c2e3..1f14f309 100644
--- a/python/bowdst.py
+++ b/python/bowdst.py
@@ -111,8 +111,9 @@ def load_val_report(workdate: datetime.date):
"local_notional_value",
"base_notional_value",
]:
- df[col] = df[col].apply(lambda s: "-" + s[1:-1] if s.startswith("(") else s)
- df[col] = pd.to_numeric(df[col].str.replace(",", ""))
+ if df[col].dtype != "float64":
+ df[col] = df[col].apply(lambda s: "-" + s[1:-1] if s.startswith("(") else s)
+ df[col] = pd.to_numeric(df[col].str.replace(",", ""))
df["row"] = df.index
df.to_sql("bowdst_val", dawn_engine, if_exists="append", index=False)