1515import numpy as np
1616import pandas as pd
1717import scipy .sparse
18- from filelock import FileLock
1918
2019import openml
2120from openml .base import OpenMLBase
21+ from openml .utils ._openml import file_lock
2222
2323from .data_feature import OpenMLDataFeature
2424
@@ -467,7 +467,7 @@ def _parse_data_from_arff( # noqa: C901, PLR0912, PLR0915
467467 List[str]: List of column names.
468468 """
469469 lock_path = str (arff_file_path ) + ".lock"
470- with FileLock (lock_path ):
470+ with file_lock (lock_path ):
471471 try :
472472 data = self ._get_arff (self .format )
473473 except OSError as e :
@@ -618,7 +618,7 @@ def _parse_data_from_file(
618618
619619 def _parse_data_from_pq (self , data_file : Path ) -> tuple [list [str ], list [bool ], pd .DataFrame ]:
620620 lock_path = str (data_file ) + ".lock"
621- with FileLock (lock_path ):
621+ with file_lock (lock_path ):
622622 try :
623623 data = pd .read_parquet (data_file )
624624 except Exception as e :
@@ -635,7 +635,7 @@ def _load_data(self) -> tuple[pd.DataFrame, list[bool], list[str]]: # noqa: PLR
635635 if need_to_create_pickle or need_to_create_feather :
636636 cache_file = self .data_pickle_file if need_to_create_pickle else self .data_feather_file
637637 lock_path = str (cache_file ) + ".lock"
638- with FileLock (lock_path ):
638+ with file_lock (lock_path ):
639639 if self .data_file is None :
640640 self ._download_data ()
641641
0 commit comments