
    4i%                     D   S SK Jr  S SKJr  S SKJr  S SKJr  \" S5       SSSSSSSSS.S	\S
\S-  S\	\\4   S-  S\
\   S-  S\S-  S\S\S-  S\S-  S\	\\4   S-  S\4S jjj5       r SSSSSS.S\S	\S
\S-  S\	\\4   S-  S\S-  S\S\	\\4   S-  SS4S jjjrg)    )Any)import_optional_dependency)
set_module)	DataFramepandasNT)catalog_propertiescolumns
row_filtercase_sensitivesnapshot_idlimitscan_propertiestable_identifiercatalog_namer   r	   r
   r   r   r   r   returnc          	         [        S5      n	[        S5      n
Uc  0 nU	R                  " U40 UD6nUR                  U 5      nUc  U
R                  5       nUc  SnO[	        U5      nUc  0 nUR                  UUUUUUS9nUR                  5       $ )a  
Read an Apache Iceberg table into a pandas DataFrame.

.. versionadded:: 3.0.0

.. warning::

   read_iceberg is experimental and may change without warning.

Parameters
----------
table_identifier : str
    Table identifier.
catalog_name : str, optional
    The name of the catalog.
catalog_properties : dict of {str: str}, optional
    The properties that are used next to the catalog configuration.
columns : list of str, optional
    A list of strings representing the column names to return in the output
    dataframe.
row_filter : str, optional
    A string that describes the desired rows.
case_sensitive : bool, default True
    If True column matching is case sensitive.
snapshot_id : int, optional
    Snapshot ID to time travel to. By default the table will be scanned as of the
    current snapshot ID.
limit : int, optional
    An integer representing the number of rows to return in the scan result.
    By default all matching rows will be fetched.
scan_properties : dict of {str: obj}, optional
    Additional Table properties as a dictionary of string key value pairs to use
    for this scan.

Returns
-------
DataFrame
    DataFrame based on the Iceberg table.

See Also
--------
read_parquet : Read a Parquet file.

Examples
--------
>>> df = pd.read_iceberg(
...     table_identifier="my_table",
...     catalog_name="my_catalog",
...     catalog_properties={"s3.secret-access-key": "my-secret"},
...     row_filter="trip_distance >= 10.0",
...     columns=["VendorID", "tpep_pickup_datetime"],
... )  # doctest: +SKIP
pyiceberg.catalogzpyiceberg.expressions)*)r
   selected_fieldsr   r   optionsr   )r   load_catalog
load_table
AlwaysTruetuplescan	to_pandas)r   r   r   r	   r
   r   r   r   r   pyiceberg_catalogpyiceberg_expressionscatalogtabler   results                  S/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/pandas/io/iceberg.pyread_icebergr#      s    D 33FG67NO!,,\P=OPG/0E*557
 .ZZ'%  F     F)r   locationappendsnapshot_propertiesdfr%   r&   r'   c                "   [        S5      n[        S5      nUc  0 nUR                  " U40 UD6n	UR                  R                  U 5      n
U	R	                  UU
R
                  US9nUc  0 nU(       a  UR                  XS9  gUR                  XS9  g)a  
Write a DataFrame to an Apache Iceberg table.

.. versionadded:: 3.0.0

Parameters
----------
table_identifier : str
    Table identifier.
catalog_name : str, optional
    The name of the catalog.
catalog_properties : dict of {str: str}, optional
    The properties that are used next to the catalog configuration.
location : str, optional
    Location for the table.
append : bool, default False
    If ``True``, append data to the table, instead of replacing the content.
snapshot_properties : dict of {str: str}, optional
    Custom properties to be added to the snapshot summary

See Also
--------
read_iceberg : Read an Apache Iceberg table.
DataFrame.to_parquet : Write a DataFrame in Parquet format.
pyarrowr   N)
identifierschemar%   )r'   )r   r   Tablefrom_pandascreate_table_if_not_existsr,   r&   	overwrite)r(   r   r   r   r%   r&   r'   par   r   arrow_tabler    s               r"   
to_icebergr3   f   s    F 
$I	.B23FG!,,\P=OPG((&&r*K..#!! / E " [JMr$   )N)typingr   pandas.compat._optionalr   pandas.util._decoratorsr   r   r   strdictlistboolintr#   r3    r$   r"   <module>r=      s   ? .  H  $W 15 $!"-1WW*W S#X-	W
 #YW d
W W tW :W #s(^d*W W Wz  $5N
 15155N5N5N *5N
 S#X-5N Dj5N 5N c3h$.5N 
5Nr$   