Skip to content

Implement Unit Tests for Python Native to Engine Format Conversion #184

Open
@badmonster0

Description

@badmonster0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions