You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/type-system.md
+43-2Lines changed: 43 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
## Motivation
4
4
5
5
Feast uses an internal type system to provide guarantees on training and serving data.
6
-
Feast supports primitive types, array types, and map types for feature values.
6
+
Feast supports primitive types, array types, set types, and map types for feature values.
7
7
Null types are not supported, although the `UNIX_TIMESTAMP` type is nullable.
8
8
The type system is controlled by [`Value.proto`](https://github.com/feast-dev/feast/blob/master/protos/feast/types/Value.proto) in protobuf and by [`types.py`](https://github.com/feast-dev/feast/blob/master/sdk/python/feast/types.py) in Python.
9
9
Type conversion logic can be found in [`type_map.py`](https://github.com/feast-dev/feast/blob/master/sdk/python/feast/type_map.py).
@@ -40,6 +40,23 @@ All primitive types have corresponding array (list) types:
40
40
|`Array(Bool)`|`List[bool]`| List of booleans |
41
41
|`Array(UnixTimestamp)`|`List[datetime]`| List of timestamps |
42
42
43
+
### Set Types
44
+
45
+
All primitive types (except Map) have corresponding set types for storing unique values:
46
+
47
+
| Feast Type | Python Type | Description |
48
+
|------------|-------------|-------------|
49
+
|`Set(Int32)`|`Set[int]`| Set of unique 32-bit integers |
50
+
|`Set(Int64)`|`Set[int]`| Set of unique 64-bit integers |
51
+
|`Set(Float32)`|`Set[float]`| Set of unique 32-bit floats |
52
+
|`Set(Float64)`|`Set[float]`| Set of unique 64-bit floats |
53
+
|`Set(String)`|`Set[str]`| Set of unique strings |
54
+
|`Set(Bytes)`|`Set[bytes]`| Set of unique binary data |
55
+
|`Set(Bool)`|`Set[bool]`| Set of unique booleans |
56
+
|`Set(UnixTimestamp)`|`Set[datetime]`| Set of unique timestamps |
57
+
58
+
**Note:** Set types automatically remove duplicate values. When converting from lists or other iterables to sets, duplicates are eliminated.
59
+
43
60
### Map Types
44
61
45
62
Map types allow storing dictionary-like data structures:
@@ -60,7 +77,7 @@ from datetime import timedelta
60
77
from feast import Entity, FeatureView, Field, FileSource
0 commit comments