lancedb_haystack.schema.serialization

Functions

field_to_dict(→ dict)

Convert a PyArrow field to a dictionary representation, including nested fields.

pyarrow_struct_to_dict(→ dict)

Convert a PyArrow StructType to a dictionary representation, including nested fields.

pyarrow_schema_to_dict(→ dict)

Convert a PyArrow schema to a JSON representation.

dict_to_field(→ pyarrow.Field)

Convert a dictionary representation of a field back to a PyArrow field, including nested fields.

dict_to_pyarrow_struct(→ pyarrow.StructType)

Convert a dict representation of a struct type back to a PyArrow StructType.

dict_to_pyarrow_schema(→ pyarrow.Schema)

Convert a dict representation of a schema back to a PyArrow schema.

Module Contents

lancedb_haystack.schema.serialization.field_to_dict(field: pyarrow.Field) dict

Convert a PyArrow field to a dictionary representation, including nested fields.

Parameters:

field – The PyArrow field to convert.

Returns:

The dictionary representation of the field.

lancedb_haystack.schema.serialization.pyarrow_struct_to_dict(struct_type: pyarrow.StructType) dict

Convert a PyArrow StructType to a dictionary representation, including nested fields.

Parameters:

struct_type – The PyArrow StructType to convert.

Returns:

The dictionary representation of the StructType.

lancedb_haystack.schema.serialization.pyarrow_schema_to_dict(schema: pyarrow.Schema) dict

Convert a PyArrow schema to a JSON representation.

Parameters:

schema – The PyArrow schema to convert.

Returns:

The JSON representation of the schema.

lancedb_haystack.schema.serialization.dict_to_field(field_dict: dict) pyarrow.Field

Convert a dictionary representation of a field back to a PyArrow field, including nested fields.

Parameters:

field_dict – The dictionary representation of the field.

Returns:

The reconstructed PyArrow field.

lancedb_haystack.schema.serialization.dict_to_pyarrow_struct(struct_dict: dict) pyarrow.StructType

Convert a dict representation of a struct type back to a PyArrow StructType.

Parameters:

struct_dict – The dict representation of the struct.

Returns:

The reconstructed PyArrow StructType.

lancedb_haystack.schema.serialization.dict_to_pyarrow_schema(schema_dict: dict) pyarrow.Schema

Convert a dict representation of a schema back to a PyArrow schema.

Parameters:

schema_dict – The dict representation of the schema.

Returns:

The reconstructed PyArrow schema.