From 7ef5569fba5d6dcacd856f01e5188bd444f4fe33 Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Sat, 28 Aug 2021 11:11:57 +0000 Subject: [PATCH] BENCH: update `class SelectDtypes` to allow testing against 1.3.x --- asv_bench/benchmarks/dtypes.py | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/asv_bench/benchmarks/dtypes.py b/asv_bench/benchmarks/dtypes.py index c45d5a0814544..55f6be848aa13 100644 --- a/asv_bench/benchmarks/dtypes.py +++ b/asv_bench/benchmarks/dtypes.py @@ -50,15 +50,26 @@ def time_pandas_dtype_invalid(self, dtype): class SelectDtypes: - params = [ - tm.ALL_INT_NUMPY_DTYPES - + tm.ALL_INT_EA_DTYPES - + tm.FLOAT_NUMPY_DTYPES - + tm.COMPLEX_DTYPES - + tm.DATETIME64_DTYPES - + tm.TIMEDELTA64_DTYPES - + tm.BOOL_DTYPES - ] + try: + params = [ + tm.ALL_INT_NUMPY_DTYPES + + tm.ALL_INT_EA_DTYPES + + tm.FLOAT_NUMPY_DTYPES + + tm.COMPLEX_DTYPES + + tm.DATETIME64_DTYPES + + tm.TIMEDELTA64_DTYPES + + tm.BOOL_DTYPES + ] + except AttributeError: + params = [ + tm.ALL_INT_DTYPES + + tm.ALL_EA_INT_DTYPES + + tm.FLOAT_DTYPES + + tm.COMPLEX_DTYPES + + tm.DATETIME64_DTYPES + + tm.TIMEDELTA64_DTYPES + + tm.BOOL_DTYPES + ] param_names = ["dtype"] def setup(self, dtype):