dlt.destinations.impl.lance.lance_adapter
lance_adapter
def lance_adapter(
data: Any,
embed: TColumnNames = None,
merge_key: TColumnNames = None,
remove_orphans: bool = DEFAULT_REMOVE_ORPHANS) -> DltResource
Prepares data for the Lance destination by specifying which columns should be embedded.
Arguments:
dataAny - The data to be transformed. It can be raw data or an instance of DltResource. If raw data, the function wraps it into aDltResourceobject.embedTColumnNames - Specify columns to generate embeddings for. It can be a single column name as a string, or a list of column names.merge_keyTColumnNames - Specify columns to merge on. It can be a single column name as a string, or a list of column names.remove_orphansbool - Whether to remove orphaned records in child tables with no parent records after merges to maintain referential integrity.
Returns:
DltResource- A resource with applied Lance-specific hints.
Raises:
ValueError- If input forembedis invalid or empty, or no arguments are provided.
Example:
data = [{"name": "Marcel", "description": "Moonbase Engineer"}]
lance_adapter(data, embed="description")
[DltResource with hints applied]