Skip to content

Commit 932d737

Browse files
author
Kei
committed
Change pyarrow to optional import in agg_series() method
1 parent 97b3d54 commit 932d737

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/core/groupby/ops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
)
1919

2020
import numpy as np
21-
import pyarrow as pa
2221

2322
from pandas._libs import (
2423
NaT,
@@ -937,6 +936,8 @@ def agg_series(
937936
and npvalues.dtype != np.dtype("object")
938937
and npvalues.dtype != np.dtype("complex128")
939938
):
939+
import pyarrow as pa
940+
940941
pyarrow_dtype = pa.from_numpy_dtype(npvalues.dtype)
941942
pandas_pyarrow_dtype = ArrowDtype(pyarrow_dtype)
942943
out = pd_array(npvalues, dtype=pandas_pyarrow_dtype)

0 commit comments

Comments
 (0)