Skip to content

Commit 43255a7

Browse files
Adding experimental note, fixing typos and adding user guide docs
1 parent 1290931 commit 43255a7

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

doc/source/user_guide/io.rst

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5417,7 +5417,7 @@ engines to safely work with the same tables at the same time.
54175417

54185418
Iceberg support predicate pushdown and column pruning, which are available to pandas
54195419
users via the ``row_filter`` and ``selected_fields`` parameters of the :func:`~pandas.read_iceberg`
5420-
function. This is convenient to extract from large tables a subset that fits in memory asa
5420+
function. This is convenient to extract from large tables a subset that fits in memory as a
54215421
pandas ``DataFrame``.
54225422

54235423
Internally, pandas uses PyIceberg_ to query Iceberg.
@@ -5497,6 +5497,29 @@ parameter:
54975497
Reading a particular snapshot is also possible providing the snapshot ID as an argument to
54985498
``snapshot_id``.
54995499

5500+
To save a ``DataFrame`` to Iceberg, it can be done with the :meth:`DataFrame.to_iceberg`
5501+
method:
5502+
5503+
.. code-block:: python
5504+
5505+
df.to_iceberg("my_table", catalog_name="my_catalog")
5506+
5507+
To specify the catalog, it works in the same way as for :func:`read_iceberg` with the
5508+
``catalog_name`` and ``catalog_properties`` parameters.
5509+
5510+
The location of the table can be specified with the ``location`` parameter:
5511+
5512+
.. code-block:: python
5513+
5514+
df.to_iceberg(
5515+
"my_table",
5516+
catalog_name="my_catalog",
5517+
location="s://my-data-lake/my-iceberg-tables",
5518+
)
5519+
5520+
It is possible to add properties to the table snapshot by passing a dictionary to the
5521+
``snapshot_properties`` parameter.
5522+
55005523
More information about the Iceberg format can be found in the `Apache Iceberg official
55015524
page <https://iceberg.apache.org/>`__.
55025525

pandas/core/frame.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3561,6 +3561,10 @@ def to_iceberg(
35613561
35623562
.. versionadded:: 3.0.0
35633563
3564+
.. warning::
3565+
3566+
to_iceberg is experimental and may change without warning.
3567+
35643568
Parameters
35653569
----------
35663570
table_identifier : str

pandas/io/iceberg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ def read_iceberg(
2222
"""
2323
Read an Apache Iceberg table into a pandas DataFrame.
2424
25+
.. versionadded:: 3.0.0
26+
2527
.. warning::
2628
2729
read_iceberg is experimental and may change without warning.

0 commit comments

Comments
 (0)