From e301fde3c13747a5e7d1231f2a3e805cf90ad3ef Mon Sep 17 00:00:00 2001 From: "ZhengYu, Xu" Date: Fri, 30 Aug 2024 15:33:35 +0800 Subject: [PATCH] fix: pa.dictionary and pa.schema annotation (#59) * fix pa.dictionary annotation * fix: schema annotation --- pyarrow-stubs/__lib_pxi/types.pyi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyarrow-stubs/__lib_pxi/types.pyi b/pyarrow-stubs/__lib_pxi/types.pyi index c973cac..eb6042d 100644 --- a/pyarrow-stubs/__lib_pxi/types.pyi +++ b/pyarrow-stubs/__lib_pxi/types.pyi @@ -396,6 +396,11 @@ def map_(key_type: _K, item_type: _IndexT) -> MapType[_K, _IndexT, Literal[False def map_( key_type: _K, item_type: _IndexT, key_sorted: _Ordered ) -> MapType[_K, _IndexT, _Ordered]: ... +@overload +def dictionary( + index_type: _IndexT, value_type: _ValueT +) -> DictionaryType[_IndexT, _ValueT, Literal[False]]: ... +@overload def dictionary( index_type: _IndexT, value_type: _ValueT, ordered: _Ordered ) -> DictionaryType[_IndexT, _ValueT, _Ordered]: ... @@ -570,7 +575,7 @@ def ensure_type(ty: Literal["duration[ns]"]) -> DurationType[Literal["ns"]]: ... @overload def ensure_type(ty: Literal["month_day_nano_interval"]) -> MonthDayNanoIntervalType: ... def schema( - fields: Iterable[Field | tuple[str, Field]] | Mapping[str, Field], + fields: Iterable[Field] | Iterable[tuple[str, DataType]] | Mapping[str, DataType], metadata: dict[bytes, bytes] | None = None, ) -> Schema: ... def from_numpy_dtype(dtype: np.dtype) -> DataType: ...