tadeja commented on code in PR #55592:
URL: https://github.com/apache/arrow/pull/55592#discussion_r4762542953


##########
python/pyarrow-stubs/__lib/scalar.pyi:
##########
@@ -15,11 +15,430 @@
 # 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,
+    ChunkedArray,
+    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. An Array or ChunkedArray
+    # operand gives one of the same kind, a Scalar or a number gives a Scalar.
+    # Other operands (e.g. a list or a date) may give either.
+    @overload
+    def __add__(self, other: ChunkedArray, /) -> ChunkedArray: ...
+    @overload
+    def __add__(self, other: Array, /) -> Array: ...
+    @overload
+    def __add__(self, other: Scalar | float, /) -> Scalar: ...

Review Comment:
   Applied in a11e6ca



-- 
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]

Reply via email to