Skip to content

Commit a676932

Browse files
authored
add typing to dtype args (#39018)
1 parent 10bdde6 commit a676932

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/core/common.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
import contextlib
99
from functools import partial
1010
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
1212
import warnings
1313

1414
import numpy as np
1515

1616
from pandas._libs import lib
17-
from pandas._typing import AnyArrayLike, Scalar, T
17+
from pandas._typing import AnyArrayLike, NpDtype, Scalar, T
1818
from pandas.compat.numpy import np_version_under1p18
1919

2020
from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike
@@ -195,7 +195,7 @@ def count_not_none(*args) -> int:
195195
return sum(x is not None for x in args)
196196

197197

198-
def asarray_tuplesafe(values, dtype=None):
198+
def asarray_tuplesafe(values, dtype: Optional[NpDtype] = None) -> np.ndarray:
199199

200200
if not (isinstance(values, (list, tuple)) or hasattr(values, "__array__")):
201201
values = list(values)
@@ -218,7 +218,7 @@ def asarray_tuplesafe(values, dtype=None):
218218
return result
219219

220220

221-
def index_labels_to_array(labels, dtype=None):
221+
def index_labels_to_array(labels, dtype: Optional[NpDtype] = None) -> np.ndarray:
222222
"""
223223
Transform label or iterable of labels to array, for use in Index.
224224

0 commit comments

Comments
 (0)