Skip to content

Commit ef431af

Browse files
committed
Revert "Remove StringArrayTypes type hint"
This reverts commit ce76152.
1 parent ce76152 commit ef431af

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pygmt/_typing.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22
Type aliases for type hints.
33
"""
44

5+
import contextlib
6+
import importlib
7+
from collections.abc import Sequence
58
from typing import Literal
69

10+
import numpy as np
11+
712
# Anchor codes
813
AnchorCode = Literal["TL", "TC", "TR", "ML", "MC", "MR", "BL", "BC", "BR"]
14+
15+
# String array types
16+
StringArrayTypes = Sequence[str] | np.ndarray
17+
with contextlib.suppress(ImportError):
18+
StringArrayTypes |= importlib.import_module(name="pyarrow").StringArray

0 commit comments

Comments
 (0)