diff --git a/ci/deps/actions-37-db-min.yaml b/ci/deps/actions-37-db-min.yaml index 65c4c5769b1a3..cae4361ca37a7 100644 --- a/ci/deps/actions-37-db-min.yaml +++ b/ci/deps/actions-37-db-min.yaml @@ -6,7 +6,7 @@ dependencies: # tools - cython>=0.29.21 - - pytest>=5.0.1 + - pytest>=6.0 - pytest-cov - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/actions-37-db.yaml b/ci/deps/actions-37-db.yaml index fa58f412cebf4..e568f8615a8df 100644 --- a/ci/deps/actions-37-db.yaml +++ b/ci/deps/actions-37-db.yaml @@ -6,7 +6,7 @@ dependencies: # tools - cython>=0.29.21 - - pytest>=5.0.1 + - pytest>=6.0 - pytest-xdist>=1.21 - hypothesis>=3.58.0 - pytest-cov>=2.10.1 # this is only needed in the coverage build, ref: GH 35737 @@ -25,7 +25,7 @@ dependencies: - flask - nomkl - numexpr - - numpy=1.16.* + - numpy=1.17.* - odfpy - openpyxl - pandas-gbq diff --git a/ci/deps/actions-37-locale_slow.yaml b/ci/deps/actions-37-locale_slow.yaml index d9ad1f538908e..c6eb3b00a63ac 100644 --- a/ci/deps/actions-37-locale_slow.yaml +++ b/ci/deps/actions-37-locale_slow.yaml @@ -7,7 +7,7 @@ dependencies: # tools - cython>=0.29.21 - - pytest>=5.0.1 + - pytest>=6.0 - pytest-cov - pytest-xdist>=1.21 - hypothesis>=3.58.0 @@ -17,13 +17,13 @@ dependencies: - bottleneck=1.2.* - lxml - matplotlib=3.0.0 - - numpy=1.16.* + - numpy=1.17.* - openpyxl=3.0.0 - python-dateutil - python-blosc - pytz=2017.3 - scipy - - sqlalchemy=1.2.8 + - sqlalchemy=1.3.0 - xlrd=1.2.0 - xlsxwriter=1.0.2 - xlwt=1.3.0 diff --git a/ci/deps/actions-37-slow.yaml b/ci/deps/actions-37-slow.yaml index 573ff7f02c162..166f2237dcad3 100644 --- a/ci/deps/actions-37-slow.yaml +++ b/ci/deps/actions-37-slow.yaml @@ -7,7 +7,7 @@ dependencies: # tools - cython>=0.29.21 - - pytest>=5.0.1 + - pytest>=6.0 - pytest-cov - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/actions-37.yaml b/ci/deps/actions-37.yaml index a209a9099d2bb..0effe6f80df86 100644 --- a/ci/deps/actions-37.yaml +++ b/ci/deps/actions-37.yaml @@ -7,7 +7,7 @@ dependencies: # tools - cython>=0.29.21 - - pytest>=5.0.1 + - pytest>=6.0 - pytest-cov - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/actions-38-locale.yaml b/ci/deps/actions-38-locale.yaml index 629804c71e726..34a6860936550 100644 --- a/ci/deps/actions-38-locale.yaml +++ b/ci/deps/actions-38-locale.yaml @@ -6,7 +6,7 @@ dependencies: # tools - cython>=0.29.21 - - pytest>=5.0.1 + - pytest>=6.0 - pytest-cov - pytest-xdist>=1.21 - pytest-asyncio>=0.12.0 @@ -20,7 +20,7 @@ dependencies: - jinja2 - jedi<0.18.0 - lxml - - matplotlib <3.3.0 + - matplotlib<3.3.0 - moto - nomkl - numexpr diff --git a/ci/deps/actions-38-numpydev.yaml b/ci/deps/actions-38-numpydev.yaml index e7ee6ccfd7bac..1c1ea582a3454 100644 --- a/ci/deps/actions-38-numpydev.yaml +++ b/ci/deps/actions-38-numpydev.yaml @@ -5,7 +5,7 @@ dependencies: - python=3.8.* # tools - - pytest>=5.0.1 + - pytest>=6.0 - pytest-cov - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/actions-38-slow.yaml b/ci/deps/actions-38-slow.yaml index 2106f48755560..afba60e451b90 100644 --- a/ci/deps/actions-38-slow.yaml +++ b/ci/deps/actions-38-slow.yaml @@ -6,7 +6,7 @@ dependencies: # tools - cython>=0.29.21 - - pytest>=5.0.1 + - pytest>=6.0 - pytest-cov - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/actions-38.yaml b/ci/deps/actions-38.yaml index e2660d07c3558..11daa92046eb4 100644 --- a/ci/deps/actions-38.yaml +++ b/ci/deps/actions-38.yaml @@ -7,7 +7,7 @@ dependencies: # tools - cython>=0.29.21 - - pytest>=5.0.1 + - pytest>=6.0 - pytest-cov - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/actions-39.yaml b/ci/deps/actions-39.yaml index 36e8bf528fc3e..b74f1af8ee0f6 100644 --- a/ci/deps/actions-39.yaml +++ b/ci/deps/actions-39.yaml @@ -6,7 +6,7 @@ dependencies: # tools - cython>=0.29.21 - - pytest>=5.0.1 + - pytest>=6.0 - pytest-cov - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/azure-macos-37.yaml b/ci/deps/azure-macos-37.yaml index a0b1cdc684d2c..63e858eac433f 100644 --- a/ci/deps/azure-macos-37.yaml +++ b/ci/deps/azure-macos-37.yaml @@ -6,7 +6,7 @@ dependencies: - python=3.7.* # tools - - pytest>=5.0.1 + - pytest>=6.0 - pytest-xdist>=1.21 - hypothesis>=3.58.0 - pytest-azurepipelines diff --git a/ci/deps/azure-windows-37.yaml b/ci/deps/azure-windows-37.yaml index 8266e3bc4d07d..5cbc029f8c03d 100644 --- a/ci/deps/azure-windows-37.yaml +++ b/ci/deps/azure-windows-37.yaml @@ -7,7 +7,7 @@ dependencies: # tools - cython>=0.29.21 - - pytest>=5.0.1 + - pytest>=6.0 - pytest-xdist>=1.21 - hypothesis>=3.58.0 - pytest-azurepipelines diff --git a/ci/deps/azure-windows-38.yaml b/ci/deps/azure-windows-38.yaml index 200e695a69d1f..7fdecae626f9d 100644 --- a/ci/deps/azure-windows-38.yaml +++ b/ci/deps/azure-windows-38.yaml @@ -7,7 +7,7 @@ dependencies: # tools - cython>=0.29.21 - - pytest>=5.0.1 + - pytest>=6.0 - pytest-xdist>=1.21 - hypothesis>=3.58.0 - pytest-azurepipelines diff --git a/ci/deps/travis-37-arm64.yaml b/ci/deps/travis-37-arm64.yaml index 8df6104f43a50..995ebda1f97e7 100644 --- a/ci/deps/travis-37-arm64.yaml +++ b/ci/deps/travis-37-arm64.yaml @@ -6,7 +6,7 @@ dependencies: # tools - cython>=0.29.21 - - pytest>=5.0.1 + - pytest>=6.0 - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/doc/source/whatsnew/v1.3.0.rst b/doc/source/whatsnew/v1.3.0.rst index c26f8288f59ab..be7eb466a37e0 100644 --- a/doc/source/whatsnew/v1.3.0.rst +++ b/doc/source/whatsnew/v1.3.0.rst @@ -615,7 +615,7 @@ Optional libraries below the lowest tested version may still work, but are not c +-----------------+-----------------+---------+ | scipy | 1.2.0 | | +-----------------+-----------------+---------+ -| sqlalchemy | 1.2.8 | | +| sqlalchemy | 1.3.0 | X | +-----------------+-----------------+---------+ | tabulate | 0.8.7 | X | +-----------------+-----------------+---------+ diff --git a/pandas/compat/_optional.py b/pandas/compat/_optional.py index 2c184c38e6b1a..941c59592dbbd 100644 --- a/pandas/compat/_optional.py +++ b/pandas/compat/_optional.py @@ -22,11 +22,11 @@ "openpyxl": "3.0.0", "pandas_gbq": "0.12.0", "pyarrow": "0.17.0", - "pytest": "5.0.1", + "pytest": "6.0", "pyxlsb": "1.0.6", "s3fs": "0.4.0", "scipy": "1.2.0", - "sqlalchemy": "1.2.8", + "sqlalchemy": "1.3.0", "tables": "3.5.1", "tabulate": "0.8.7", "xarray": "0.12.3", diff --git a/pandas/compat/numpy/function.py b/pandas/compat/numpy/function.py index 63ea5554e32d7..69dc3ac417510 100644 --- a/pandas/compat/numpy/function.py +++ b/pandas/compat/numpy/function.py @@ -22,10 +22,7 @@ Union, ) -from numpy import ( - __version__, - ndarray, -) +from numpy import ndarray from pandas._libs.lib import ( is_bool, @@ -38,8 +35,6 @@ validate_kwargs, ) -from pandas.util.version import Version - class CompatValidator: def __init__( @@ -128,10 +123,7 @@ def validate_argmax_with_skipna(skipna, args, kwargs): ARGSORT_DEFAULTS["axis"] = -1 ARGSORT_DEFAULTS["kind"] = "quicksort" ARGSORT_DEFAULTS["order"] = None - -if Version(__version__) >= Version("1.17.0"): - # GH-26361. NumPy added radix sort and changed default to None. - ARGSORT_DEFAULTS["kind"] = None +ARGSORT_DEFAULTS["kind"] = None validate_argsort = CompatValidator( diff --git a/pandas/core/arrays/string_arrow.py b/pandas/core/arrays/string_arrow.py index d5ee28eb7017e..4370f3a4e15cf 100644 --- a/pandas/core/arrays/string_arrow.py +++ b/pandas/core/arrays/string_arrow.py @@ -26,6 +26,7 @@ pa_version_under3p0, pa_version_under4p0, ) +from pandas.compat.pyarrow import pa_version_under1p0 from pandas.util._decorators import doc from pandas.util._validators import validate_fillna_kwargs @@ -52,7 +53,6 @@ validate_indices, ) from pandas.core.strings.object_array import ObjectStringArrayMixin -from pandas.util.version import Version try: import pyarrow as pa @@ -62,7 +62,7 @@ # PyArrow backed StringArrays are available starting at 1.0.0, but this # file is imported from even if pyarrow is < 1.0.0, before pyarrow.compute # and its compute functions existed. GH38801 - if Version(pa.__version__) >= Version("1.0.0"): + if not pa_version_under1p0: import pyarrow.compute as pc ARROW_CMP_FUNCS = { @@ -232,7 +232,7 @@ def __init__(self, values): def _chk_pyarrow_available(cls) -> None: # TODO: maybe update import_optional_dependency to allow a minimum # version to be specified rather than use the global minimum - if pa is None or Version(pa.__version__) < Version("1.0.0"): + if pa is None or pa_version_under1p0: msg = "pyarrow>=1.0.0 is required for PyArrow backed StringArray." raise ImportError(msg) diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index 34d5edee06791..bccf3c3f1011b 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -210,27 +210,21 @@ def read( to_pandas_kwargs = {} if use_nullable_dtypes: - if Version(self.api.__version__) >= Version("0.16"): - import pandas as pd - - mapping = { - self.api.int8(): pd.Int8Dtype(), - self.api.int16(): pd.Int16Dtype(), - self.api.int32(): pd.Int32Dtype(), - self.api.int64(): pd.Int64Dtype(), - self.api.uint8(): pd.UInt8Dtype(), - self.api.uint16(): pd.UInt16Dtype(), - self.api.uint32(): pd.UInt32Dtype(), - self.api.uint64(): pd.UInt64Dtype(), - self.api.bool_(): pd.BooleanDtype(), - self.api.string(): pd.StringDtype(), - } - to_pandas_kwargs["types_mapper"] = mapping.get - else: - raise ValueError( - "'use_nullable_dtypes=True' is only supported for pyarrow >= 0.16 " - f"({self.api.__version__} is installed" - ) + import pandas as pd + + mapping = { + self.api.int8(): pd.Int8Dtype(), + self.api.int16(): pd.Int16Dtype(), + self.api.int32(): pd.Int32Dtype(), + self.api.int64(): pd.Int64Dtype(), + self.api.uint8(): pd.UInt8Dtype(), + self.api.uint16(): pd.UInt16Dtype(), + self.api.uint32(): pd.UInt32Dtype(), + self.api.uint64(): pd.UInt64Dtype(), + self.api.bool_(): pd.BooleanDtype(), + self.api.string(): pd.StringDtype(), + } + to_pandas_kwargs["types_mapper"] = mapping.get manager = get_option("mode.data_manager") if manager == "array": to_pandas_kwargs["split_blocks"] = True # type: ignore[assignment]