File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 23
23
)
24
24
25
25
import numpy as np
26
+ from packaging .version import parse
26
27
import pandas as pd
27
28
from pandas ._testing import (
28
29
ensure_clean ,
43
44
from pandas .io .formats .style import Styler
44
45
from pandas .io .parsers import TextFileReader
45
46
47
+ PD_LTE_15 = parse (pd .__version__ ) < parse ("1.5.999" )
48
+
46
49
DF = pd .DataFrame (data = {"col1" : [1 , 2 ], "col2" : [3 , 4 ]})
47
50
48
51
@@ -933,10 +936,16 @@ def test_types_describe() -> None:
933
936
}
934
937
)
935
938
df .describe ()
936
- with pytest .warns (FutureWarning , match = "Treating datetime data as categorical" ):
939
+ if PD_LTE_15 :
940
+ with pytest .warns (FutureWarning , match = "Treating datetime data as categorical" ):
941
+ df .describe (percentiles = [0.5 ], include = "all" )
942
+ else :
943
+ df .describe (percentiles = [0.5 ], include = "all" )
944
+ if PD_LTE_15 :
945
+ with pytest .warns (FutureWarning , match = "Treating datetime data as categorical" ):
946
+ df .describe (exclude = [np .number ])
947
+ else :
937
948
df .describe (percentiles = [0.5 ], include = "all" )
938
- with pytest .warns (FutureWarning , match = "Treating datetime data as categorical" ):
939
- df .describe (exclude = [np .number ])
940
949
# datetime_is_numeric param added in 1.1.0 https://pandas.pydata.org/docs/whatsnew/v1.1.0.html
941
950
df .describe (datetime_is_numeric = True )
942
951
You can’t perform that action at this time.
0 commit comments