lancedb_haystack.conversion.lancedb_to_python ============================================= .. py:module:: lancedb_haystack.conversion.lancedb_to_python Functions --------- .. autoapisummary:: lancedb_haystack.conversion.lancedb_to_python.convert_lancedb_to_document lancedb_haystack.conversion.lancedb_to_python.convert_field lancedb_haystack.conversion.lancedb_to_python.convert_struct lancedb_haystack.conversion.lancedb_to_python.convert_timestamp Module Contents --------------- .. py:function:: convert_lancedb_to_document(result: dict, schema: pyarrow.Schema) -> haystack.Document Convert a lancedb result into a document :param result: the result from the LanceDB query :param schema: the lancedb table schema :return: a haystack Document .. py:function:: convert_field(value: Any, field_type: pyarrow.DataType) -> Any Converts the value of a field from it's representation in LanceDB to the one used for Haystack :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 Converts the metadata section of the LanceDB representation of a Document to a Haystack Document. This involves filtering out empty fields, as well as handling some type conversions to ensure that it complies with the expected Haystack DocumentStore behaviour. :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: datetime.datetime, field_type: pyarrow.DataType) Convert timestamp values to isoformat as expected by Haystack :param value: the value to convert :param field_type: The pyarrow type of the value, in this case, is ignored. :return: the converted value