diff options
Diffstat (limited to 'python/quote_parsing/parse_emails.py')
| -rw-r--r-- | python/quote_parsing/parse_emails.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/python/quote_parsing/parse_emails.py b/python/quote_parsing/parse_emails.py index ad9052ee..9747ddba 100644 --- a/python/quote_parsing/parse_emails.py +++ b/python/quote_parsing/parse_emails.py @@ -22,7 +22,7 @@ def list_imm_dates(date): return r -def makedf(r, indextype, quote_source): +def makedf(r, indextype, quote_source, region="US"): if indextype in ["IG", "EU", "XO"]: cols = [ "strike", @@ -47,7 +47,7 @@ def makedf(r, indextype, quote_source): "price_vol", ] if quote_source == "BAML": - cols.append("gamma") # (ref_id,) = next(c) + cols.append("gamma") # (ref_id,) = next(c) if quote_source == "GS" and region == "US": cols.append("tail") df = pd.DataFrame.from_records(r, columns=cols) @@ -681,7 +681,6 @@ def parse_jpm(fh, index_desc): def parse_gs_eu_block(fh, indextype): - indextype = "XO" r = [] for line in fh: print(line) @@ -869,7 +868,6 @@ def parse_email(email: Path, date_received: datetime.date, conn): def write_todb(swaption_stack, index_data, conn): - breakpoint() sql_str = sql.SQL( "INSERT INTO swaption_ref_quotes({}) VALUES({}) " "ON CONFLICT DO NOTHING RETURNING ref_id" @@ -886,9 +884,7 @@ def write_todb(swaption_stack, index_data, conn): for t in index_data.itertuples(index=False): c.execute(sql_str, t) try: - # debug, please remove after - ref_id = "9999999" - # (ref_id,) = next(c) + (ref_id,) = next(c) except StopIteration: continue else: |
