aboutsummaryrefslogtreecommitdiffstats
path: root/python/markit/rates.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/markit/rates.py')
-rw-r--r--python/markit/rates.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/markit/rates.py b/python/markit/rates.py
index a105648a..7f2f87e8 100644
--- a/python/markit/rates.py
+++ b/python/markit/rates.py
@@ -4,6 +4,7 @@ from serenitas.utils.env import DATA_DIR
from io import BytesIO
from psycopg import sql
from psycopg.types.range import Range
+from pyisda.curve import Fmt
import requests
import xml.etree.ElementTree as ET
import zipfile
@@ -78,10 +79,10 @@ def downloadMarkitIRData(
ct = CurveType[f"{currency}_{ref_index[currency]}_ISDA"].value
else:
ct = CurveType[f"{currency}_ISDA"].value
- with conn.cursor() as c:
+ with conn.cursor(binary=True) as c:
c.execute(
sql_str,
- (MarkitData["effectiveasof"], ct, jp_yc.__getstate__()),
+ (MarkitData["effectiveasof"], ct, jp_yc.as_bytes(Fmt.Packed)),
)
effectiveasof = MarkitData.pop("effectiveasof")
instruments = list(chain.from_iterable(MarkitData.values()))