Skip to content

Commit

Permalink
Use "string" instead of pyarrow.string() in case pyarrow not installed
Browse files Browse the repository at this point in the history
Fixes `AttributeError: 'NoneType' object has no attribute 'string'`
  • Loading branch information
weiji14 committed Oct 11, 2024
1 parent d379e46 commit cfda386
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pygmt/tests/test_clib_put_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
),
Expand Down
2 changes: 1 addition & 1 deletion pygmt/tests/test_clib_virtualfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
),
Expand Down

0 comments on commit cfda386

Please sign in to comment.