Skip to content

Commit 8e2a8de

Browse files
committed
Add conditional to support string[pyarrow_numpy] for pandas<=2.2
Handle pd.StringDtype not having the na_value parameter in pandas 2.2 and below.
1 parent 4573f7e commit 8e2a8de

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pygmt/tests/test_clib_to_numpy.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,12 @@ def test_to_numpy_pandas_numeric_with_na(dtype, expected_dtype):
372372
"string[python]",
373373
pytest.param("string[pyarrow]", marks=skip_if_no(package="pyarrow")),
374374
pytest.param(
375-
pd.StringDtype(storage="pyarrow", na_value=np.nan),
375+
# TODO(pandas>=2.3): Remove the string[pyarrow_numpy] else statement
376+
(
377+
pd.StringDtype(storage="pyarrow", na_value=np.nan)
378+
if Version(pd.__version__) < Version("2.3.0")
379+
else "string[pyarrow_numpy]"
380+
),
376381
marks=skip_if_no(package="pyarrow"),
377382
),
378383
],

0 commit comments

Comments
 (0)