From 249574c346c776141b47bbc85140354c703bc99e Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Wed, 6 Dec 2023 13:13:32 +0100 Subject: [PATCH] Improve docs --- py-polars/polars/dataframe/frame.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/py-polars/polars/dataframe/frame.py b/py-polars/polars/dataframe/frame.py index 9555cb9d36b5..322aa67e6cb2 100644 --- a/py-polars/polars/dataframe/frame.py +++ b/py-polars/polars/dataframe/frame.py @@ -3648,19 +3648,21 @@ def write_delta( mode : {'error', 'append', 'overwrite', 'ignore', 'merge'} How to handle existing data. - * If 'error', throw an error if the table already exists (default). - * If 'append', will add new data. - * If 'overwrite', will replace table with new data. - * If 'ignore', will not write anything if table already exists. + - If 'error', throw an error if the table already exists (default). + - If 'append', will add new data. + - If 'overwrite', will replace table with new data. + - If 'ignore', will not write anything if table already exists. + - If 'merge', return a `TableMerger` object to merge data from the DataFrame + with the existing data. overwrite_schema If True, allows updating the schema of the table. storage_options Extra options for the storage backends supported by `deltalake`. For cloud storages, this may include configurations for authentication etc. - * See a list of supported storage options for S3 `here `__. - * See a list of supported storage options for GCS `here `__. - * See a list of supported storage options for Azure `here `__. + - See a list of supported storage options for S3 `here `__. + - See a list of supported storage options for GCS `here `__. + - See a list of supported storage options for Azure `here `__. delta_write_options Additional keyword arguments while writing a Delta lake Table. See a list of supported write options `here `__. @@ -3717,7 +3719,7 @@ def write_delta( ... existing_table_path, mode="overwrite", overwrite_schema=True ... ) # doctest: +SKIP - Write a dataframe as a Delta Lake table to a cloud object store like S3. + Write a DataFrame as a Delta Lake table to a cloud object store like S3. >>> table_path = "s3://bucket/prefix/to/delta-table/" >>> df.write_delta( @@ -3740,12 +3742,12 @@ def write_delta( ... }, ... ) # doctest: +SKIP - Merging dataframe to the local filesystem as a Delta Lake table. For a - cloud object store just pass storage_options or a DeltaTable object. - For all additional TableMerger methods check the deltalake docs `here `__. + Merge the DataFrame with an existing Delta Lake table. + For all `TableMerger` methods, check the deltalake docs + `here `__. - Schema evolution is currently not yet supported in deltalake, therefore - overwrite_schema won't have any effect during `MERGE`. + Schema evolution is not yet supported in by the `deltalake` package, therefore + `overwrite_schema` will not have any effect on a merge operation. >>> df = pl.DataFrame( ... {