From ed82080557a6fc9fb36c8860e155ec411e88302a Mon Sep 17 00:00:00 2001
From: Louis Maddox <louismmx@gmail.com>
Date: Thu, 16 Jan 2025 11:14:44 +0000
Subject: [PATCH] docs: Include documentation on how to change compression
 algorithm (#20739)

---
 py-polars/polars/dataframe/frame.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/py-polars/polars/dataframe/frame.py b/py-polars/polars/dataframe/frame.py
index fc6f892a25ca..d779c1e35103 100644
--- a/py-polars/polars/dataframe/frame.py
+++ b/py-polars/polars/dataframe/frame.py
@@ -4420,6 +4420,21 @@ def write_delta(
         ...     },
         ... )  # doctest: +SKIP
 
+        Write DataFrame as a Delta Lake table with zstd compression.
+        For all `delta_write_options` keyword arguments, check the deltalake docs
+        `here
+        <https://delta-io.github.io/delta-rs/api/delta_writer/#deltalake.write_deltalake>`__,
+        and for Writer Properties in particular `here
+        <https://delta-io.github.io/delta-rs/api/delta_writer/#deltalake.WriterProperties>`__.
+
+        >>> import deltalake
+        >>> df.write_delta(
+        ...     table_path,
+        ...     delta_write_options={
+        ...         "writer_properties": deltalake.WriterProperties(compression="zstd"),
+        ...     },
+        ... )  # doctest: +SKIP
+
         Merge the DataFrame with an existing Delta Lake table.
         For all `TableMerger` methods, check the deltalake docs
         `here <https://delta-io.github.io/delta-rs/api/delta_table/delta_table_merger/>`__.