mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-18 18:04:31 +08:00
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 <you-n-g@users.noreply.github.com> * Update collector.py * Update collector.py * Update collector.py Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
This commit is contained in:
@@ -138,7 +138,10 @@ class YahooCollector(BaseCollector):
|
|||||||
else:
|
else:
|
||||||
_show_logging_func()
|
_show_logging_func()
|
||||||
except Exception as e:
|
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(
|
def get_data(
|
||||||
self, symbol: str, interval: str, start_datetime: pd.Timestamp, end_datetime: pd.Timestamp
|
self, symbol: str, interval: str, start_datetime: pd.Timestamp, end_datetime: pd.Timestamp
|
||||||
@@ -154,7 +157,9 @@ class YahooCollector(BaseCollector):
|
|||||||
end=end_,
|
end=end_,
|
||||||
)
|
)
|
||||||
if resp is None or resp.empty:
|
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
|
return resp
|
||||||
|
|
||||||
_result = None
|
_result = None
|
||||||
|
|||||||
Reference in New Issue
Block a user