File tree Expand file tree Collapse file tree 3 files changed +9
-19
lines changed Expand file tree Collapse file tree 3 files changed +9
-19
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ print(Schema.validate(df))
140
140
>
141
141
> And all of the rest of your pandera code should work. Using the top- level
142
142
> `pandera` module to access `DataFrameSchema` and the other pandera classes
143
- > or functions will be deprecated in a future version
143
+ > or functions will be deprecated in version ` 0.29 .0`
144
144
145
145
146
146
# # Next steps
Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ import pandera.pandas as pa
257
257
258
258
And all of the rest of your pandera code should work. Using the top-level
259
259
` pandera ` module to access ` DataFrameSchema ` and the other pandera classes
260
- or functions will be deprecated in a future version
260
+ or functions will be deprecated in version ` 0.29.0 `
261
261
:::
262
262
263
263
## Informative Errors
Original file line number Diff line number Diff line change 4
4
from pandera ._version import __version__
5
5
6
6
7
- _warning_msg = """Pandas and numpy have been removed from the base pandera
8
- dependencies. Please install pandas as part of your environment's
9
- dependencies or install the pandas extra with:
10
-
11
- ```bash
12
- pip install pandas pandera
13
-
14
- # or
15
- pip install 'pandera[pandas]'
16
- ```
17
- """
18
-
19
-
20
7
try :
21
8
# Only add pandas to the top-level pandera namespace
22
9
# if pandas and numpy are installed
33
20
* _pandas_deprecated_all ,
34
21
]
35
22
36
- except ImportError as err :
23
+ except ( ImportError , ModuleNotFoundError ) as err :
37
24
import warnings
38
25
39
26
err_msg = str (err )
40
- if err_msg in {"No module named 'pandas'" , "No module named 'numpy'" }:
41
- warnings .warn (_warning_msg , UserWarning )
42
- elif err_msg .startswith ("pandera requires pandas >= 2.1.1" ):
27
+ if err_msg .startswith ("pandera requires pandas >= 2.1.1" ):
43
28
warnings .warn (err_msg , UserWarning )
29
+ elif err_msg .startswith (
30
+ ("No module named 'pandas'" , "No module named 'numpy'" )
31
+ ):
32
+ # ignore this error
33
+ pass
44
34
else :
45
35
raise # Re-raise any other `ImportError` exceptions
46
36
You can’t perform that action at this time.
0 commit comments