From 7dc353b61ee1c9393d87c79e91c23ab03fe30a93 Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Fri, 15 Nov 2024 14:31:55 +1300 Subject: [PATCH] Revert support of pyarrow.array inputs to put_strings --- pygmt/clib/session.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pygmt/clib/session.py b/pygmt/clib/session.py index b8d6ff6feb1..10c8770adaa 100644 --- a/pygmt/clib/session.py +++ b/pygmt/clib/session.py @@ -1029,8 +1029,7 @@ def put_strings(self, dataset: ctp.c_void_p, family: str, strings: np.ndarray): Raises ------ GMTCLibError - If given invalid input or ``GMT_Put_Strings`` exits with - status != 0. + If given invalid input or ``GMT_Put_Strings`` exits with a non-zero status. """ c_put_strings = self.get_libgmt_func( "GMT_Put_Strings", @@ -1051,8 +1050,7 @@ def put_strings(self, dataset: ctp.c_void_p, family: str, strings: np.ndarray): self.session_pointer, family_int, dataset, strings_pointer ) if status != 0: - dtype = strings.dtype if hasattr(strings, "dtype") else type(strings) - msg = f"Failed to put strings of type {dtype} into dataset." + msg = f"Failed to put strings of type {strings.dtype} into dataset." raise GMTCLibError(msg) def put_matrix(self, dataset: ctp.c_void_p, matrix: np.ndarray, pad: int = 0):