Skip to content

DEPS: clean outdated version compat, sync min versions #41576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/deps/actions-37-db-min.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-37-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,7 +25,7 @@ dependencies:
- flask
- nomkl
- numexpr
- numpy=1.16.*
- numpy=1.17.*
- odfpy
- openpyxl
- pandas-gbq
Expand Down
6 changes: 3 additions & 3 deletions ci/deps/actions-37-locale_slow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-37-slow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-37.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-38-locale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -20,7 +20,7 @@ dependencies:
- jinja2
- jedi<0.18.0
- lxml
- matplotlib <3.3.0
- matplotlib<3.3.0
- moto
- nomkl
- numexpr
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-38-numpydev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-38-slow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/azure-macos-37.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/azure-windows-37.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/azure-windows-38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/travis-37-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v1.3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
+-----------------+-----------------+---------+
Expand Down
4 changes: 2 additions & 2 deletions pandas/compat/_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 2 additions & 10 deletions pandas/compat/numpy/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
Union,
)

from numpy import (
__version__,
ndarray,
)
from numpy import ndarray

from pandas._libs.lib import (
is_bool,
Expand All @@ -38,8 +35,6 @@
validate_kwargs,
)

from pandas.util.version import Version


class CompatValidator:
def __init__(
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/arrays/string_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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 = {
Expand Down Expand Up @@ -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)

Expand Down
36 changes: 15 additions & 21 deletions pandas/io/parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down