-
lance.LanceDataset.update(updates: dict[str, str], where: str | None =
None
) UpdateResult Update column values for rows matching where.
- Parameters:
- Returns:
updates – A dictionary containing the number of rows updated.
- Return type:
dict
Examples
>>> import lance >>> import pyarrow as pa >>> table = pa.table({"a": [1, 2, 3], "b": ["a", "b", "c"]}) >>> dataset = lance.write_dataset(table, "example") >>> update_stats = dataset.update(dict(a = 'a + 2'), where="b != 'a'") >>> update_stats["num_updated_rows"] = 2 >>> dataset.to_table().to_pandas() a b 0 1 a 1 4 b 2 5 c