File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 36
36
except ImportError as err :
37
37
import warnings
38
38
39
- if "pandas" in str (err ) or "numpy" in str (err ):
39
+ err_msg = str (err )
40
+ if err_msg in {"No module named 'pandas'" , "No module named 'numpy'" }:
40
41
warnings .warn (_warning_msg , UserWarning )
42
+ elif err_msg .startswith ("pandera requires pandas >= 2.1.1" ):
43
+ warnings .warn (err_msg , UserWarning )
41
44
else :
42
45
raise # Re-raise any other `ImportError` exceptions
43
46
Original file line number Diff line number Diff line change 22
22
if parse (pd .__version__ ) < _min_pandas_version :
23
23
raise ImportError (
24
24
"pandera requires pandas >= 2.1.1, but you have pandas "
25
- f"{ pd .__version__ } . Please upgrade pandas to the minimum supported version."
25
+ f"{ pd .__version__ } . Using the pandera.pandas module may not work as "
26
+ "expected. It's highly recommended to upgrade pandas to the minimum "
27
+ "supported version."
26
28
)
27
29
28
30
if parse (np .__version__ ) < _min_numpy_version :
29
31
raise ImportError (
30
32
"pandera requires numpy >= 1.24.4, but you have numpy "
31
- f"{ np .__version__ } . Please upgrade numpy to the minimum supported version."
33
+ f"{ np .__version__ } . Using the pandera.pandas module may not work as "
34
+ "expected. It's highly recommended to upgrade numpy to the minimum "
35
+ "supported version."
32
36
)
33
37
34
38
from pandera ._patch_numpy2 import _patch_numpy2
Original file line number Diff line number Diff line change 5
5
6
6
_patch_numpy2 ()
7
7
8
+ import pandera .backends .base .builtin_checks
9
+ import pandera .backends .base .builtin_hypotheses
8
10
import pandera .backends .pyspark
9
11
from pandera import errors , external_config
10
12
from pandera .accessors import pyspark_sql_accessor
You can’t perform that action at this time.
0 commit comments