11from typing import (
2+ TYPE_CHECKING ,
23 Any ,
34)
45
56from pandas .compat ._optional import import_optional_dependency
67
78from pandas import DataFrame
89
10+ if TYPE_CHECKING :
11+ from pyiceberg .catalog import Catalog # noqa: TC004
912
10- def _get_catalog (catalog_name : str | None , catalog_properties : dict [str , Any ] | None ):
13+
14+ def _get_catalog (
15+ catalog_name : str | None , catalog_properties : dict [str , Any ] | None
16+ ) -> Catalog :
1117 pyiceberg_catalog = import_optional_dependency ("pyiceberg.catalog" )
1218 if catalog_properties is None :
1319 catalog_properties = {}
@@ -105,7 +111,7 @@ def to_iceberg(
105111 catalog_properties : dict [str , Any ] | None = None ,
106112 location : str | None = None ,
107113 snapshot_properties : dict [str , str ] | None = None ,
108- ):
114+ ) -> None :
109115 """
110116 Write a DataFrame to an Apache Iceberg table.
111117
@@ -128,11 +134,6 @@ def to_iceberg(
128134 --------
129135 read_iceberg : Read an Apache Iceberg table.
130136 DataFrame.to_parquet : Write a DataFrame in Parquet format.
131-
132- Examples
133- --------
134- >>> df = pd.DataFrame(data={"col1": [1, 2], "col2": [4, 3]})
135- >>> df.to_iceberg("my_table", catalog_name="my_catalog")
136137 """
137138 pa = import_optional_dependency ("pyarrow" )
138139
0 commit comments