diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/collateral/common.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/python/collateral/common.py b/python/collateral/common.py index aaa9d8a9..d6dc958e 100644 --- a/python/collateral/common.py +++ b/python/collateral/common.py @@ -100,7 +100,12 @@ def send_email(d: datetime.date, df: pd.DataFrame) -> None: html = "<html><body>" for cp, df in df.groupby(level="broker"): name = cp_mapping[cp] - html += f"<h3> At {name}:</h3>\n{df.loc[cp].to_html(index=False)}" + try: + html += f"<h3> At {name}:</h3>\n{df.loc[cp].to_html(index=False)}" + except AttributeError: + html += ( + f"<h3> At {name}:</h3>\n{df.loc[cp].to_frame().T.to_html(index=False)}" + ) em = ExchangeMessage() em.send_email( f"IAM booking {d:%Y-%m-%d}", |
