Skip to content

Commit 18bca5f

Browse files
committed
Fix check_pandas_support import error introduced by sklearn 1.5.0
With sklearn version 1.5.0 the check_pandas_support function has been moved to util._optional_dependencies. This has been adapted in our code.
1 parent dd31493 commit 18bca5f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/skmatter/datasets/_base.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
from os.path import dirname, join
22

33
import numpy as np
4-
from sklearn.utils import Bunch, check_pandas_support
4+
import sklearn
5+
6+
7+
if sklearn.__version__ >= "1.5.0":
8+
from sklearn.utils._optional_dependencies import check_pandas_support
9+
else:
10+
from sklearn.utils import check_pandas_support
11+
12+
from sklearn.utils import Bunch
513

614

715
def load_nice_dataset():

0 commit comments

Comments
 (0)