Relax requests_cache purging - allow empty earnings calendar table

feature/session-prune-v2
ValueRaider 2023-02-07 20:38:51 +00:00
parent 4d8ca3777a
commit efd278a3e0
1 changed files with 7 additions and 1 deletions

View File

@ -362,7 +362,13 @@ class TickerData:
elif "/calendar/earnings?" in r.url:
try:
dfs = _pd.read_html(r.text)
except Exception:
except ValueError as e:
if "No tables found" in str(e):
# Maybe this ticker doesn't have any earnings dates
pass
else:
parse_failed = True
except Exception as e:
parse_failed = True
else:
r.yf_html_pd = dfs