Skip to content

Commit

Permalink
fix: pandas 2 plus check & remove pyarrow string equivalent
Browse files Browse the repository at this point in the history
Signed-off-by: Ajith Aravind <[email protected]>
  • Loading branch information
aaravind100 committed May 9, 2024
1 parent 3580c6c commit 361102e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pandera/engines/pandas_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@

PANDAS_1_2_0_PLUS = pandas_version().release >= (1, 2, 0)
PANDAS_1_3_0_PLUS = pandas_version().release >= (1, 3, 0)
PANDAS_2_0_0_PLUS = pandas_version().release >= (2, 0, 0)


# register different TypedDict type depending on python version
Expand Down Expand Up @@ -1588,7 +1589,7 @@ def __str__(self) -> str:
# pyarrow types
###############################################################################

if PYARROW_INSTALLED:
if PYARROW_INSTALLED and PANDAS_2_0_0_PLUS:

@Engine.register_dtype(equivalents=["bool[pyarrow]", pyarrow.bool_])
@immutable
Expand Down Expand Up @@ -1629,7 +1630,7 @@ class ArrowInt8(ArrowInt16):
type = pd.ArrowDtype(pyarrow.int8())
bit_width: int = 8

@Engine.register_dtype(equivalents=["string[pyarrow]", pyarrow.string])
@Engine.register_dtype(equivalents=[pyarrow.string])
@immutable
class ArrowString(DataType, dtypes.String):
"""Semantic representation of a :class:`pyarrow.string`."""
Expand Down

0 comments on commit 361102e

Please sign in to comment.