File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
tests/data_mid_layer_tests Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,6 @@ description = "A Quantitative-research Platform"
2323requires-python = " >=3.8.0"
2424readme = {file = " README.md" , content-type = " text/markdown" }
2525
26- # On 2025-04-02 osqp released version 1.0.2, osqp is used as a dependency for cvxpy.
27- # It would lead to errors installing qlib, so we limited the version of osqp.
28- # refs: https://github.com/osqp/osqp/issues/728
2926dependencies = [
3027 " pyyaml" ,
3128 " numpy" ,
@@ -42,7 +39,6 @@ dependencies = [
4239 " loguru" ,
4340 " lightgbm" ,
4441 " gym" ,
45- " osqp<1.0.2" ,
4642 " cvxpy" ,
4743 " joblib" ,
4844 " matplotlib" ,
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ def __call__(self, df):
196196 # nan_select[:, ~df.columns.isin(cols)] = False
197197 # df.values[nan_select] = self.fill_value
198198
199- df [self .fields_group ] = df [self .fields_group ].fillna (0 )
199+ df [self .fields_group ] = df [self .fields_group ].fillna (self . fill_value )
200200 return df
201201
202202
Original file line number Diff line number Diff line change 1010from qlib .data .dataset .loader import NestedDataLoader , QlibDataLoader
1111from qlib .data .dataset .handler import DataHandlerLP
1212from qlib .contrib .data .loader import Alpha158DL , Alpha360DL
13+ from qlib .data .dataset .processor import Fillna
1314from qlib .data import D
1415
1516
@@ -45,6 +46,13 @@ def test_nested_data_loader(self):
4546
4647 assert "LABEL0" in columns_list
4748
49+ assert dataset .isna ().any ().any ()
50+
51+ fn = Fillna (fields_group = "feature" , fill_value = 0 )
52+ fn_dataset = fn .__call__ (dataset )
53+
54+ assert not fn_dataset .isna ().any ().any ()
55+
4856 # Then you can use it wth DataHandler;
4957 # NOTE: please note that the data processors are missing!!! You should add based on your requirements
5058
You can’t perform that action at this time.
0 commit comments