From 6b474b406a080f912c831d32673e2c1caa11a080 Mon Sep 17 00:00:00 2001 From: Dean MacGregor Date: Tue, 15 Oct 2024 09:24:37 -0400 Subject: [PATCH 1/2] add type property to Array --- pyarrow-stubs/__lib_pxi/array.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyarrow-stubs/__lib_pxi/array.pyi b/pyarrow-stubs/__lib_pxi/array.pyi index fac68c8..6438da8 100644 --- a/pyarrow-stubs/__lib_pxi/array.pyi +++ b/pyarrow-stubs/__lib_pxi/array.pyi @@ -1056,6 +1056,8 @@ class Array(_PandasConvertible[pd.Series], Generic[_Scalar_CoT]): ) -> Array[Scalar[_CastAs]]: ... def view(self, target_type: _CastAs) -> Array[Scalar[_CastAs]]: ... def sum(self, **kwargs) -> _Scalar_CoT: ... + @property + def type(self) -> DataType: ... def unique(self) -> Self: ... def dictionary_encode(self, null_encoding: str = "mask") -> DictionaryArray: ... @overload From 0a53f61fe6398802cda48b3a437f38743e8781cb Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Wed, 16 Oct 2024 10:03:50 +0800 Subject: [PATCH 2/2] Array.type should return covariant --- pyarrow-stubs/__lib_pxi/array.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyarrow-stubs/__lib_pxi/array.pyi b/pyarrow-stubs/__lib_pxi/array.pyi index 6438da8..09b323d 100644 --- a/pyarrow-stubs/__lib_pxi/array.pyi +++ b/pyarrow-stubs/__lib_pxi/array.pyi @@ -1057,7 +1057,7 @@ class Array(_PandasConvertible[pd.Series], Generic[_Scalar_CoT]): def view(self, target_type: _CastAs) -> Array[Scalar[_CastAs]]: ... def sum(self, **kwargs) -> _Scalar_CoT: ... @property - def type(self) -> DataType: ... + def type(self: Array[Scalar[_DataType_CoT]]) -> _DataType_CoT: ... def unique(self) -> Self: ... def dictionary_encode(self, null_encoding: str = "mask") -> DictionaryArray: ... @overload