tadeja commented on code in PR #55592: URL: https://github.com/apache/arrow/pull/55592#discussion_r4746154540
########## python/pyarrow-stubs/__lib/scalar.pyi: ########## @@ -15,11 +15,378 @@ # specific language governing permissions and limitations # under the License. -# Placeholder stub - complete annotations in future PR. -# At runtime, these symbols are provided by the pyarrow.lib C extension. +import datetime as dt +from collections.abc import Iterator, Mapping, Sequence +from decimal import Decimal +from typing import Any, SupportsIndex, TypeAlias, overload +from uuid import UUID -from typing import Any +import numpy as np +from pyarrow._compute import CastOptions +from pyarrow._stubs_typing import MapsAsPydicts +from pyarrow.lib import ( + Array, + BaseExtensionType, + Buffer, + DataType, + MemoryPool, + MonthDayNano, + Tensor, + _Weakrefable, +) +from typing_extensions import CapsuleType -class ExtensionScalar: ... +class Scalar(_Weakrefable): + @property + def type(self) -> DataType: ... + @property + def is_valid(self) -> bool: ... + def cast( + self, + target_type: DataType | str | None = None, + safe: bool | None = None, + options: CastOptions | None = None, + memory_pool: MemoryPool | None = None, + ) -> Scalar: ... + def validate(self, *, full: bool = False) -> None: ... + def equals(self, other: Scalar) -> bool: ... + def as_py(self, *, maps_as_pydicts: MapsAsPydicts | None = None) -> Any: ... + def __abs__(self) -> Scalar: ... + def __neg__(self) -> Scalar: ... + # The binary operators call the compute functions, which return a scalar, + # or an (chunked) array if the other operand is one. + def __add__(self, other: Any, /) -> Any: ... Review Comment: Applied in f476d87d. scalar, int or float operand -> scalar, (chunked)array -> (chunked)array, other operands -> Any -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
