From 055ea6d2bc83611c0c31a948aeda65a3a2403b09 Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Wed, 4 Sep 2024 15:35:38 +0800 Subject: [PATCH] support build array with list of scalar (#64) --- pyarrow-stubs/__lib_pxi/array.pyi | 12 +++++++++++- pyarrow-stubs/__lib_pxi/table.pyi | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/pyarrow-stubs/__lib_pxi/array.pyi b/pyarrow-stubs/__lib_pxi/array.pyi index 5b4fd38..5888e83 100644 --- a/pyarrow-stubs/__lib_pxi/array.pyi +++ b/pyarrow-stubs/__lib_pxi/array.pyi @@ -1,4 +1,4 @@ -# mypy: disable-error-code="overload-overlap,misc" +# mypy: disable-error-code="overload-overlap,misc,type-arg" import datetime as dt @@ -173,6 +173,16 @@ def array( memory_pool: MemoryPool | None = None, ) -> ListArray: ... @overload +def array( + values: NullableIterable[_Scalar_CoT], + type: None = None, + mask: Mask | None = None, + size: int | None = None, + from_pandas: bool | None = None, + safe: bool = True, + memory_pool: MemoryPool | None = None, +) -> Array[_Scalar_CoT]: ... +@overload def array( values: Iterable | SupportArrowArray | SupportArrowDeviceArray, type: _DataTypeT, diff --git a/pyarrow-stubs/__lib_pxi/table.pyi b/pyarrow-stubs/__lib_pxi/table.pyi index a84f4a9..870552d 100644 --- a/pyarrow-stubs/__lib_pxi/table.pyi +++ b/pyarrow-stubs/__lib_pxi/table.pyi @@ -202,6 +202,11 @@ def chunked_array( type: None = None, ) -> ChunkedArray[scalar.ListScalar]: ... @overload +def chunked_array( + values: NullableIterable[_Scalar_CoT], + type: None = None, +) -> ChunkedArray[_Scalar_CoT]: ... +@overload def chunked_array( values: Iterable | SupportArrowStream | SupportArrowArray, type: _DataTypeT,