mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-30 18:49:42 +08:00
BUG: Handle a ValueError on from_csv calls
The cached market data could be corrupted. Pandas raises a ValueError in that case, and this error handles it.
This commit is contained in:
committed by
Scott Sanderson
parent
885db87dea
commit
ef598c7130
@@ -157,7 +157,7 @@ def load_market_data(trading_day=trading_day_nyse,
|
||||
bm_filepath = get_data_filepath(get_benchmark_filename(bm_symbol))
|
||||
try:
|
||||
saved_benchmarks = pd.Series.from_csv(bm_filepath)
|
||||
except (OSError, IOError):
|
||||
except (OSError, IOError, ValueError):
|
||||
logger.info(
|
||||
"No cache found at {path}. "
|
||||
"Downloading benchmark data for '{symbol}'.",
|
||||
@@ -204,7 +204,7 @@ def load_market_data(trading_day=trading_day_nyse,
|
||||
tr_filepath = get_data_filepath(filename)
|
||||
try:
|
||||
saved_curves = pd.DataFrame.from_csv(tr_filepath)
|
||||
except (OSError, IOError):
|
||||
except (OSError, IOError, ValueError):
|
||||
logger.info(
|
||||
"No cache found at {path}. "
|
||||
"Downloading treasury data from {source}.",
|
||||
|
||||
Reference in New Issue
Block a user