-
Notifications
You must be signed in to change notification settings - Fork 145
Expand file tree
/
Copy pathdtype.pyi
More file actions
79 lines (64 loc) · 2.18 KB
/
dtype.pyi
File metadata and controls
79 lines (64 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright the Vortex contributors
from typing import Literal, final
import pyarrow as pa
class DType:
def to_arrow_schema(self) -> pa.Schema: ...
def to_arrow_type(self) -> pa.DataType: ...
@classmethod
def from_arrow(cls, arrow_dtype: pa.DataType | pa.Schema, *, non_nullable: bool = False) -> DType: ...
@final
class NullDType(DType): ...
@final
class BoolDType(DType): ...
@final
class PrimitiveDType(DType):
@property
def ptype(self) -> PType: ...
@final
class DecimalDType(DType):
@property
def precision(self) -> int: ...
@property
def scale(self) -> int: ...
@final
class Utf8DType(DType): ...
@final
class BinaryDType(DType): ...
@final
class StructDType(DType):
def names(self) -> list[str]: ...
def fields(self) -> list[DType]: ...
@final
class ListDType(DType): ...
@final
class FixedSizeListDType(DType): ...
@final
class ExtensionDType(DType): ...
@final
class PType:
U8: PType
U16: PType
U32: PType
U64: PType
I8: PType
I16: PType
I32: PType
I64: PType
F16: PType
F32: PType
F64: PType
def null() -> DType: ...
def bool_(*, nullable: bool = False) -> DType: ...
def int_(width: Literal[8, 16, 32, 64] = 64, *, nullable: bool = False) -> DType: ...
def uint(width: Literal[8, 16, 32, 64] = 64, *, nullable: bool = False) -> DType: ...
def float_(width: Literal[16, 32, 64] = 64, *, nullable: bool = False) -> DType: ...
def decimal(*, precision: int = 10, scale: int = 0, nullable: bool = False) -> DType: ...
def utf8(*, nullable: bool = False) -> DType: ...
def binary(*, nullable: bool = False) -> DType: ...
def struct(fields: dict[str, DType] | None = None, *, nullable: bool = False) -> DType: ...
def list_(element: DType, *, nullable: bool = False) -> DType: ...
def fixed_size_list(element: DType, size: int, *, nullable: bool = False) -> DType: ...
def date(unit: Literal["ms", "days"], *, nullable: bool = False) -> DType: ...
def time(unit: Literal["s", "ms", "us", "ns"], *, nullable: bool = False) -> DType: ...
def timestamp(unit: Literal["s", "ms", "us", "ns"], *, tz: str | None = None, nullable: bool = False) -> DType: ...