Skip to content

Commit

Permalink
Pin pyarrow>=13 and use pytest.mark.skipif on string_view type test
Browse files Browse the repository at this point in the history
Lower pyarrow pin from 16 to 13, and added a skipif pytest marker to the `test_to_numpy_pyarrow_array_pyarrow_dtypes_string[string_view]` unit test to not run when pyarrow<16 is installed. Setting a pin on pyarrow>=13 so that datetime64 unit preservation is handled, xref apache/arrow#33321.
  • Loading branch information
weiji14 committed Nov 22, 2024
1 parent 7d542a9 commit 4733bda
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion pygmt/tests/test_clib_to_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import pandas as pd
import pytest
from packaging.version import Version
from pygmt._show_versions import _get_module_version
from pygmt.clib.conversion import _to_numpy
from pygmt.helpers.testing import skip_if_no

Expand Down Expand Up @@ -323,7 +324,13 @@ def test_to_numpy_pyarrow_array_pyarrow_dtypes_numeric_with_na(dtype, expected_d
"utf8", # alias for string
"large_string",
"large_utf8", # alias for large_string
"string_view",
pytest.param(
"string_view",
marks=pytest.mark.skipif(
Version(_get_module_version("pyarrow")) < Version("16"),
reason="string_view type was added since pyarrow 16",
),
),
],
)
def test_to_numpy_pyarrow_array_pyarrow_dtypes_string(dtype):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ all = [
"contextily>=1.2",
"geopandas>=0.14",
"IPython>=8", # 'ipython' is not the correct module name.
"pyarrow>=16",
"pyarrow>=13",
"rioxarray>=0.14",
]

Expand Down

0 comments on commit 4733bda

Please sign in to comment.