Open
Description
Enhancement
Add Unit test to convert.py for to_engine_value
Objective:
Develop unit tests to validate the functionality of the to_engine_value function, ensuring it accurately converts Python native data types into the engine-compatible format.
Background:
- This module provide conversions between two data formats:
- Values in Python native data types
- Values in data structure exchangeable with cocoindex core engine (in Rust)
- Related issue for conversion from Engine to Python Format
The key difference is about how they handle Struct type
-
In Python native data formats, it's represented by a
dataclass
(see the doc). Example:Order(order_id='O123', name='mixed nuts', price=25.0)
-
In the exchangeable format with the core engine, it's a list of all fields. Example:
['O123', 'mixed nuts', 25.0]
Scope:
- The test need to cover different types:
- Various basic types, struct types and collection types as listed in the doc
- Composition of various types, e.g. list of struct, struct with list fields, struct with struct fields