Skip to content

Commit

Permalink
COMPAT: bump pyarrow min version for div on duration (#55048)
Browse files Browse the repository at this point in the history
COMPAT: bump pyarrow min version test for div on duration
  • Loading branch information
bnavigator authored Sep 8, 2023
1 parent 5cf6e74 commit 9aa3f95
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pandas/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
pa_version_under9p0,
pa_version_under11p0,
pa_version_under13p0,
pa_version_under14p0,
)

if TYPE_CHECKING:
Expand Down Expand Up @@ -186,6 +187,7 @@ def get_bz2_file() -> type[pandas.compat.compressors.BZ2File]:
"pa_version_under9p0",
"pa_version_under11p0",
"pa_version_under13p0",
"pa_version_under14p0",
"IS64",
"ISMUSL",
"PY310",
Expand Down
2 changes: 2 additions & 0 deletions pandas/compat/pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
pa_version_under11p0 = _palv < Version("11.0.0")
pa_version_under12p0 = _palv < Version("12.0.0")
pa_version_under13p0 = _palv < Version("13.0.0")
pa_version_under14p0 = _palv < Version("14.0.0")
except ImportError:
pa_version_under7p0 = True
pa_version_under8p0 = True
Expand All @@ -23,3 +24,4 @@
pa_version_under11p0 = True
pa_version_under12p0 = True
pa_version_under13p0 = True
pa_version_under14p0 = True
3 changes: 2 additions & 1 deletion pandas/tests/extension/test_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
pa_version_under9p0,
pa_version_under11p0,
pa_version_under13p0,
pa_version_under14p0,
)

from pandas.core.dtypes.dtypes import (
Expand Down Expand Up @@ -917,7 +918,7 @@ def _is_temporal_supported(self, opname, pa_dtype):
or (
opname
in ("__truediv__", "__rtruediv__", "__floordiv__", "__rfloordiv__")
and not pa_version_under13p0
and not pa_version_under14p0
)
)
and pa.types.is_duration(pa_dtype)
Expand Down

0 comments on commit 9aa3f95

Please sign in to comment.