lancedb_haystack.conversion.python_to_lancedb ============================================= .. py:module:: lancedb_haystack.conversion.python_to_lancedb Functions --------- .. autoapisummary:: lancedb_haystack.conversion.python_to_lancedb.convert_document_to_lancedb lancedb_haystack.conversion.python_to_lancedb.convert_field lancedb_haystack.conversion.python_to_lancedb.convert_struct lancedb_haystack.conversion.python_to_lancedb.convert_timestamp Module Contents --------------- .. py:function:: convert_document_to_lancedb(document: haystack.Document, schema: pyarrow.Schema) -> dict Converts a Haystack Document to a format ready to store in lancedb :param document: the Haystack document to prepare for insertion into LanceDB :param schema: the lancedb table schema :return: a dict .. py:function:: convert_field(value: Any, field_type: pyarrow.DataType) Converts the value of a field from it's representation in haystack to the one used for LanceDB :param value: the value to convert :param field_type: The pyarrow type of the value, so we know how to convert it. :return: the converted value .. py:function:: convert_struct(value: dict, field_type: pyarrow.StructType) -> dict Convert a dict into the format expected by LanceDB :param value: the value to convert :param field_type: The pyarrow type of the value, so we know how to convert it. :return: the converted value .. py:function:: convert_timestamp(value: Union[datetime.datetime, str], field_type: pyarrow.DataType) -> pyarrow.Scalar Convert datetime or iso string into the format expected by LanceDB. :param value: the value to convert :param field_type: The pyarrow type of the value, so we know how to convert it. :return: the converted value