i%dddlmZddlmZddlmZddlmZed dddddddddd ed edzd e eefdzd e edzd edzde de dzde dzde eefdzdefdZ ddddddded ed edzd e eefdzdedzde de eefdzddfdZdS))Any)import_optional_dependency) set_module) DataFramepandasNT)catalog_propertiescolumns row_filtercase_sensitive snapshot_idlimitscan_propertiestable_identifier catalog_namerr r r r r rreturncFtd} td} |i}| j|fi|} | |} || }|d} nt |} |i}| || ||||}|S)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.catalogzpyiceberg.expressionsN)*)r selected_fieldsr r optionsr )r load_catalog load_table AlwaysTruetuplescan to_pandas)rrrr r r r r rpyiceberg_catalogpyiceberg_expressionscatalogtablerresults ?C:\PYTHON\_runtimes\venv\Lib\site-packages\pandas/io/iceberg.py read_icebergr# sD33FGG67NOO!,,\PP=OPPG   / 0 0E*5577  .. ZZ'% F     F)rlocationappendsnapshot_propertiesdfr%r&r'c@td}td}|i}|j|fi|} |j|} | || j|} |i}|r| | |dS| | |dS)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. pyarrowrN) identifierschemar%)r')rrTable from_pandascreate_table_if_not_existsr,r& overwrite) r(rrrr%r&r'parr arrow_tabler s r" to_icebergr3fsF $I . .B23FGG!,,\PP=OPPG(&&r**K  . .#! /  E"  N [6I JJJJJ  9LMMMMMr$)N)typingrpandas.compat._optionalrpandas.util._decoratorsrrrstrdictlistboolintr#r3r$r"r=s?>>>>>...... H $W15 $!"-1WWWW*WS#X- W #Y  W d WWtW :W#s(^d*WWWWWz $5N 15155N5N5N5N5N*5N S#X- 5N Dj 5N 5Nc3h$.5N 5N5N5N5N5N5Nr$