8
8
import contextlib
9
9
from functools import partial
10
10
import inspect
11
- from typing import Any , Collection , Iterable , Iterator , List , Union , cast
11
+ from typing import Any , Collection , Iterable , Iterator , List , Optional , Union , cast
12
12
import warnings
13
13
14
14
import numpy as np
15
15
16
16
from pandas ._libs import lib
17
- from pandas ._typing import AnyArrayLike , Scalar , T
17
+ from pandas ._typing import AnyArrayLike , NpDtype , Scalar , T
18
18
from pandas .compat .numpy import np_version_under1p18
19
19
20
20
from pandas .core .dtypes .cast import construct_1d_object_array_from_listlike
@@ -195,7 +195,7 @@ def count_not_none(*args) -> int:
195
195
return sum (x is not None for x in args )
196
196
197
197
198
- def asarray_tuplesafe (values , dtype = None ):
198
+ def asarray_tuplesafe (values , dtype : Optional [ NpDtype ] = None ) -> np . ndarray :
199
199
200
200
if not (isinstance (values , (list , tuple )) or hasattr (values , "__array__" )):
201
201
values = list (values )
@@ -218,7 +218,7 @@ def asarray_tuplesafe(values, dtype=None):
218
218
return result
219
219
220
220
221
- def index_labels_to_array (labels , dtype = None ):
221
+ def index_labels_to_array (labels , dtype : Optional [ NpDtype ] = None ) -> np . ndarray :
222
222
"""
223
223
Transform label or iterable of labels to array, for use in Index.
224
224
0 commit comments