From 0f519f60539a7014a957030b0869cab7b491f0d0 Mon Sep 17 00:00:00 2001 From: Wangwuyi123 <51237097+Wangwuyi123@users.noreply.github.com> Date: Sat, 12 Mar 2022 20:49:38 +0800 Subject: [PATCH] Update yahooquery marked words (#966) * Update collector.py * Update collector.py * Update collector.py * Update collector.py * Update collector.py * Update collector.py * Update collector.py * Update collector.py * Update collector.py * Update scripts/data_collector/yahoo/collector.py Co-authored-by: you-n-g * Update collector.py * Update collector.py * Update collector.py Co-authored-by: you-n-g --- scripts/data_collector/yahoo/collector.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/data_collector/yahoo/collector.py b/scripts/data_collector/yahoo/collector.py index 35cd7b6e9..e99a30d2a 100644 --- a/scripts/data_collector/yahoo/collector.py +++ b/scripts/data_collector/yahoo/collector.py @@ -138,7 +138,10 @@ class YahooCollector(BaseCollector): else: _show_logging_func() except Exception as e: - logger.warning(f"{error_msg}:{e}") + logger.warning( + f"get data error: {symbol}--{start_}--{end_}" + + "Your data request fails. This may be caused by your firewall (e.g. GFW). Please switch your network if you want to access Yahoo! data" + ) def get_data( self, symbol: str, interval: str, start_datetime: pd.Timestamp, end_datetime: pd.Timestamp @@ -154,7 +157,9 @@ class YahooCollector(BaseCollector): end=end_, ) if resp is None or resp.empty: - raise ValueError(f"get data error: {symbol}--{start_}--{end_}") + raise ValueError( + f"get data error: {symbol}--{start_}--{end_}" + "The stock may be delisted, please check" + ) return resp _result = None