Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
you-n-g committed Jul 10, 2024
1 parent 4ed5564 commit aa903c2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions qlib/data/dataset/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ def load(self, instruments, start_time=None, end_time=None) -> pd.DataFrame:
-------
pd.DataFrame:
data load from the under layer source
Raise
-----
KeyError:
if the instruments filter is not supported, raise KeyError
"""


Expand Down Expand Up @@ -323,11 +328,11 @@ def load(self, instruments=None, start_time=None, end_time=None) -> pd.DataFrame
for dl in self.data_loader_l:
try:
df_current = dl.load(instruments, start_time, end_time)
except ValueError:
df_current = dl.load(instruments=None, start_time=start_time, end_time=end_time)
except ValueError: # FIXME:
warnings.warn(
"If the value of `instruments` cannot be processed, it will set instruments to None to get all the data."
)
df_current = dl.load(instruments=None, start_time=start_time, end_time=end_time)
if df_full is None:
df_full = df_current
else:
Expand Down

0 comments on commit aa903c2

Please sign in to comment.