Skip to content

Commit 343f221

Browse files
authored
support pyarrow compute funcs (apache#61)
* update compute.pyi * impl Aggregation funcs * impl arithmetic * imit bit-wise functions * imit rounding functions * optimize annotation * impl logarithmic functions * update * impl comparisons funcs * impl logical funcs * impl string predicates and transforms * impl string padding * impl string trimming * impl string splitting and component extraction * impl string joining and slicing * impl Containment tests * impl Categorizations * impl Structural transforms * impl Conversions * impl Temporal component extraction * impl random, Timezone handling * impl Array-wise functions * fix timestamp scalar
1 parent 43b8bc0 commit 343f221

3 files changed

Lines changed: 1849 additions & 39 deletions

File tree

pyarrow-stubs/__lib_pxi/scalar.pyi

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# mypy: disable-error-code="overload-overlap,misc"
1+
# mypy: disable-error-code="overload-overlap,misc,type-arg"
22
import collections.abc
33
import datetime as dt
44

@@ -281,6 +281,10 @@ def scalar(
281281
value: Decimal, *, from_pandas: bool | None = None, memory_pool: MemoryPool | None = None
282282
) -> Decimal128Scalar: ...
283283
@overload
284+
def scalar(
285+
value: dt.datetime, *, from_pandas: bool | None = None, memory_pool: MemoryPool | None = None
286+
) -> TimestampScalar: ...
287+
@overload
284288
def scalar(
285289
value: dt.date, *, from_pandas: bool | None = None, memory_pool: MemoryPool | None = None
286290
) -> Date32Scalar: ...
@@ -349,6 +353,13 @@ def scalar(
349353
memory_pool: MemoryPool | None = None,
350354
) -> ListScalar[types.ListType[types.Decimal128Type]]: ...
351355
@overload
356+
def scalar(
357+
value: CollectionValue[dt.datetime],
358+
*,
359+
from_pandas: bool | None = None,
360+
memory_pool: MemoryPool | None = None,
361+
) -> ListScalar[types.ListType[types.TimestampType]]: ...
362+
@overload
352363
def scalar(
353364
value: CollectionValue[dt.date],
354365
*,

pyarrow-stubs/__lib_pxi/table.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# mypy: disable-error-code="overload-overlap"
1+
# mypy: disable-error-code="overload-overlap,type-arg,misc"
22

33
import datetime as dt
44

@@ -162,6 +162,11 @@ def chunked_array(
162162
type: None = None,
163163
) -> ChunkedArray[scalar.StructScalar]: ...
164164
@overload
165+
def chunked_array(
166+
values: NullableIterable[dt.datetime],
167+
type: None = None,
168+
) -> ChunkedArray[scalar.TimestampScalar]: ...
169+
@overload
165170
def chunked_array(
166171
values: NullableIterable[dt.date],
167172
type: None = None,

0 commit comments

Comments
 (0)