From cfda386da577d0e2d2ab31a133f0e70770722393 Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Fri, 11 Oct 2024 18:16:59 +1300 Subject: [PATCH] Use "string" instead of pyarrow.string() in case pyarrow not installed Fixes `AttributeError: 'NoneType' object has no attribute 'string'` --- pygmt/tests/test_clib_put_strings.py | 2 +- pygmt/tests/test_clib_virtualfiles.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pygmt/tests/test_clib_put_strings.py b/pygmt/tests/test_clib_put_strings.py index 0db47ca4a8a..41f0dc921d4 100644 --- a/pygmt/tests/test_clib_put_strings.py +++ b/pygmt/tests/test_clib_put_strings.py @@ -23,7 +23,7 @@ pytest.param(np.array, {"dtype": str}, id="str"), pytest.param( getattr(pa, "array", None), - {"type": pa.string()}, + {"type": "string"}, # pa.string() marks=skip_if_no(package="pyarrow"), id="pyarrow", ), diff --git a/pygmt/tests/test_clib_virtualfiles.py b/pygmt/tests/test_clib_virtualfiles.py index 2d9b66b47d6..f0160d8bb82 100644 --- a/pygmt/tests/test_clib_virtualfiles.py +++ b/pygmt/tests/test_clib_virtualfiles.py @@ -238,7 +238,7 @@ def test_virtualfile_from_vectors(dtypes): pytest.param(np.array, {"dtype": object}, id="object"), pytest.param( getattr(pa, "array", None), - {"type": pa.string()}, + {"type": "string"}, # pa.string() marks=skip_if_no(package="pyarrow"), id="pyarrow", ),