Skip to content

Commit 0023f08

Browse files
address dtype comment
1 parent 7d98727 commit 0023f08

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pandas/core/arrays/string_arrow.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from pandas.api.types import (
3232
is_array_like,
3333
is_bool_dtype,
34-
is_int64_dtype,
3534
is_integer,
3635
is_integer_dtype,
3736
is_scalar,
@@ -284,9 +283,7 @@ def factorize(self, na_sentinel: int = -1) -> Tuple[np.ndarray, ExtensionArray]:
284283
).to_pandas()
285284
if indices.dtype.kind == "f":
286285
indices[np.isnan(indices)] = na_sentinel
287-
indices = indices.astype(int)
288-
if not is_int64_dtype(indices):
289-
indices = indices.astype(np.int64)
286+
indices = indices.astype(np.int64, copy=False)
290287

291288
if encoded.num_chunks:
292289
uniques = type(self)(encoded.chunk(0).dictionary)

0 commit comments

Comments
 (0)