@@ -15,20 +15,27 @@ This makes schema of data processed by CocoIndex clear, and easily determine the
15
15
16
16
This is the list of all basic types supported by CocoIndex:
17
17
18
- | Type | Type in Python | Original Type in Python |
19
- | ------| -----------------| --------------------------|
20
- | bytes | ` bytes ` | ` bytes ` |
21
- | str | ` str ` | ` str ` |
22
- | bool | ` bool ` | ` bool ` |
23
- | int64 | ` int ` | ` int ` |
24
- | float32 | ` cocoindex.typing.Float32 ` | ` float ` |
25
- | float64 | ` cocoindex.typing.Float64 ` | ` float ` |
26
- | range | ` cocoindex.typing.Range ` | ` tuple[int, int] ` |
27
- | uuid | ` uuid.UUId ` | ` uuid.UUID ` |
28
- | vector[ * type* , * N* ?] | ` Annotated[list[type], cocoindex.typing.Vector(dim=N)] ` | ` list[type] ` |
29
- | json | ` cocoindex.typing.Json ` | Any type convertible to JSON by ` json ` package |
30
-
31
- For some types, CocoIndex Python SDK provides annotated types with finer granularity than Python's original type, e.g. ` Float32 ` and ` Float64 ` for ` float ` , and ` vector ` has dimension information.
18
+ | Type | Description | Type in Python | Original Type in Python |
19
+ | ------| -------------| ---------------| -------------------------|
20
+ | Bytes | | ` bytes ` | ` bytes ` |
21
+ | Str | | ` str ` | ` str ` |
22
+ | Bool | | ` bool ` | ` bool ` |
23
+ | Int64 | | ` int ` | ` int ` |
24
+ | Float32 | | ` cocoindex.typing.Float32 ` | ` float ` |
25
+ | Float64 | | ` cocoindex.typing.Float64 ` | ` float ` |
26
+ | Range | | ` cocoindex.typing.Range ` | ` tuple[int, int] ` |
27
+ | Uuid | | ` uuid.UUId ` | ` uuid.UUID ` |
28
+ | Date | | ` datetime.date ` | ` datetime.date ` |
29
+ | Time | | ` datetime.time ` | ` datetime.time ` |
30
+ | LocalDatetime | Date and time without timezone | ` cocoindex.typing.LocalDateTime ` | ` datetime.datetime ` |
31
+ | OffsetDatetime | Date and time with a timezone offset | ` cocoindex.typing.OffsetDateTime ` | ` datetime.datetime ` |
32
+ | Vector[ * type* , * N* ?] | | ` Annotated[list[type], cocoindex.typing.Vector(dim=N)] ` | ` list[type] ` |
33
+ | Json | | ` cocoindex.typing.Json ` | Any type convertible to JSON by ` json ` package |
34
+
35
+ For some types, CocoIndex Python SDK provides annotated types with finer granularity than Python's original type, e.g.
36
+ * * Float32* and * Float64* for ` float ` , with different precision.
37
+ * * LocalDateTime* and * OffsetDateTime* for ` datetime.datetime ` , with different timezone awareness.
38
+ * * Vector* has dimension information.
32
39
33
40
When defining [ custom functions] ( /docs/core/custom_function ) , use the specific types as type annotations for arguments and return values.
34
41
So CocoIndex will have information about the specific type.
@@ -75,6 +82,7 @@ Currently, the following types are supported as types for key fields:
75
82
- ` int64 `
76
83
- ` range `
77
84
- ` uuid `
85
+ - ` date `
78
86
- Struct with all fields being key types
79
87
80
88
### Vector Type
0 commit comments