less.write_table(name, df) receives a Pandas DataFrame and stores it as a table in Less, and returns the id of the table it wrote.
Overwrite a specific table
Passtable_id to overwrite one particular table. This is how you write to a table that another asset created — a source, a model, or another Python script — without changing that original asset.
name must match that table; if it does not, a warning is logged and the original name is used.
Append to an existing table
Passappend=True to union the new rows onto the rows already in the table rather than replacing them.
table_id, this appends to the table your script owns under name. Combine the two to append to a specific table, including one created by another asset:
dfmust be a pandas DataFrame.- Empty DataFrames are skipped.
- Appending to a table that does not exist yet simply creates it (only when
table_idis not given). - Appending is a plain union: rows are stacked and any columns that appear on only one side are filled with nulls.