Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/docs/core/data_types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ This is the list of all basic types supported by CocoIndex:
| TimeDelta | A duration of time | `datetime.timedelta` | `datetime.timedelta` |
| Json | | `cocoindex.Json` | Any data convertible to JSON by `json` package |
| Vector[*T*, *Dim*?] | *T* can be a basic type or a numeric type. *Dim* is a positive integer and optional. | `cocoindex.Vector[T]` or `cocoindex.Vector[T, Dim]` | `numpy.typing.NDArray[T]` or `list[T]` |
| Union[*T1*, *T2*, ...] | *T1*, *T2*, ... are any basic types | `T1 | T2 | ...` | `T1 | T2 | ...` |

Values of all data types can be represented by values in Python's native types (as described under the Native Python Type column).
However, the underlying execution engine has finer distinctions for some types, specifically:
Expand Down
4 changes: 1 addition & 3 deletions python/cocoindex/tests/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ def eq(a: Any, b: Any) -> bool:
)
decoder = make_engine_value_decoder([], encoded_output_type, value_type)
decoded_value = decoder(value_from_engine)
assert eq(decoded_value, value), (
f"{decoded_value} != {value}; {encoded_value}; {value_type}; {encoded_output_type}"
)
assert eq(decoded_value, value), f"{decoded_value} != {value}"

if other_decoded_values is not None:
for other_value, other_type in other_decoded_values:
Expand Down