From 85d2bb510650daf6685311c17f826b27c8436861 Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:27:44 +1300 Subject: [PATCH] Simplify to remove getattr(pa, "array", None) call Co-Authored-By: Dongdong Tian --- pygmt/tests/test_clib_virtualfile_from_vectors.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pygmt/tests/test_clib_virtualfile_from_vectors.py b/pygmt/tests/test_clib_virtualfile_from_vectors.py index 55702f114b6..b76a9bfe168 100644 --- a/pygmt/tests/test_clib_virtualfile_from_vectors.py +++ b/pygmt/tests/test_clib_virtualfile_from_vectors.py @@ -15,8 +15,10 @@ try: import pyarrow as pa + + pa_array = pa.array except ImportError: - pa = None + pa_array = None @pytest.fixture(scope="module", name="dtypes") @@ -65,8 +67,8 @@ def test_virtualfile_from_vectors(dtypes): pytest.param(np.array, {"dtype": np.str_}, id="str"), pytest.param(np.array, {"dtype": np.object_}, id="object"), pytest.param( - getattr(pa, "array", None), - {}, # pa.string() + pa_array, + {}, # {"type": pa.string()} marks=skip_if_no(package="pyarrow"), id="pyarrow", ),