mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-13 15:56:57 +08:00
@@ -15,9 +15,9 @@ from .config import C
|
|||||||
class MetaLogger(type):
|
class MetaLogger(type):
|
||||||
def __new__(mcs, name, bases, attrs): # pylint: disable=C0204
|
def __new__(mcs, name, bases, attrs): # pylint: disable=C0204
|
||||||
wrapper_dict = logging.Logger.__dict__.copy()
|
wrapper_dict = logging.Logger.__dict__.copy()
|
||||||
for key in wrapper_dict:
|
for key, val in wrapper_dict.items():
|
||||||
if key not in attrs and key != "__reduce__":
|
if key not in attrs and key != "__reduce__":
|
||||||
attrs[key] = wrapper_dict[key]
|
attrs[key] = val
|
||||||
return type.__new__(mcs, name, bases, attrs)
|
return type.__new__(mcs, name, bases, attrs)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class GetData:
|
|||||||
target_path = target_dir.joinpath(_target_file_name)
|
target_path = target_dir.joinpath(_target_file_name)
|
||||||
|
|
||||||
url = self.merge_remote_url(file_name, dataset_version)
|
url = self.merge_remote_url(file_name, dataset_version)
|
||||||
resp = requests.get(url, stream=True)
|
resp = requests.get(url, stream=True, timeout=60)
|
||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
raise requests.exceptions.HTTPError()
|
raise requests.exceptions.HTTPError()
|
||||||
@@ -69,7 +69,7 @@ class GetData:
|
|||||||
|
|
||||||
def check_dataset(self, file_name: str, dataset_version: str = None):
|
def check_dataset(self, file_name: str, dataset_version: str = None):
|
||||||
url = self.merge_remote_url(file_name, dataset_version)
|
url = self.merge_remote_url(file_name, dataset_version)
|
||||||
resp = requests.get(url, stream=True)
|
resp = requests.get(url, stream=True, timeout=60)
|
||||||
status = True
|
status = True
|
||||||
if resp.status_code == 404:
|
if resp.status_code == 404:
|
||||||
status = False
|
status = False
|
||||||
|
|||||||
Reference in New Issue
Block a user