Ë
    ¤eh]  ã                  óf  — d Z ddlmZ ddlZddlZddlZddlmZmZm	Z	 ddl
Z
ddl
mZ ddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlZddlmZmZ ddl m!Z! ddl"m#Z# ddl$m%Z%m&Z&m'Z'm(Z(m)Z) erddl*m+Z+m,Z,m-Z-m.Z.m/Z/ d d„Z0	 	 	 d!	 	 	 	 	 	 	 	 	 	 	 d"d„Z1 G d„ d«      Z2 G d„ de2«      Z3 G d„ de2«      Z4 ee!d   ¬«      	 	 	 	 	 	 	 d#	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d$d„«       Z5 ee!d   ¬«      dddejl                  ejl                  ddf	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d%d„«       Z7y)&z parquet compat é    )ÚannotationsN)ÚTYPE_CHECKINGÚAnyÚLiteral)Úcatch_warnings)Úusing_pyarrow_string_dtype)Ú_get_option)Úlib)Úimport_optional_dependency©ÚAbstractMethodError)Údoc)Úfind_stack_level)Úcheck_dtype_backend)Ú	DataFrameÚ
get_option)Ú_shared_docs)Úarrow_string_types_mapper)Ú	IOHandlesÚ
get_handleÚis_fsspec_urlÚis_urlÚstringify_path)ÚDtypeBackendÚFilePathÚ
ReadBufferÚStorageOptionsÚWriteBufferÚBaseImplc                ó$  — | dk(  rt        d«      } | dk(  r,t        t        g}d}|D ]  }	  |«       c S  t        d|› �«      ‚| dk(  r
t        «       S | dk(  r
t        «       S t        d	«      ‚# t        $ r}|dt	        |«      z   z  }Y d}~Œdd}~ww xY w)
zreturn our implementationÚautozio.parquet.engineÚ z
 - NzÉUnable to find a usable engine; tried using: 'pyarrow', 'fastparquet'.
A suitable version of pyarrow or fastparquet is required for parquet support.
Trying to import the above resulted in these errors:ÚpyarrowÚfastparquetz.engine must be one of 'pyarrow', 'fastparquet')r   ÚPyArrowImplÚFastParquetImplÚImportErrorÚstrÚ
ValueError)ÚengineÚengine_classesÚ
error_msgsÚengine_classÚerrs        úO/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/pandas/io/parquet.pyÚ
get_enginer0   3   s½   € à�ÒÜÐ/Ó0ˆà�Òä%¤Ð7ˆàˆ
Ø*ò 	1ˆLð1Ù#“~Ò%ð	1ô ðCð ˆlðó
ð 	
ð �ÒÜ‹}ÐØ	�=Ò	 ÜÓ Ð ä
ÐEÓ
FÐFøô% ò 1Ø˜g¬¨C«Ñ0Ñ0•
ûð1ús   ªA+Á+	BÁ4B
Â
BÚstorage_optionsc                ó,  — t        | «      }|�ƒt        dd¬«      }t        dd¬«      }|�#t        ||j                  «      r|rOt	        d«      ‚|�!t        ||j
                  j                  «      rn!t        dt        |«      j                  › �«      ‚t        |«      rk|€i|€5t        d«      }t        d«      }	 |j                  j                  | «      \  }}|€Mt        d«      } |j                  j                  |fi |xs i ¤Ž\  }}n|rt!        |«      r|d	k7  rt        d
«      ‚d}	|sN|sLt        |t"        «      r<t$        j&                  j)                  |«      st+        ||d|¬«      }	d}|	j,                  }||	|fS # t        |j                  f$ r Y Œ½w xY w)zFile handling for PyArrow.Nz
pyarrow.fsÚignore)ÚerrorsÚfsspecz8storage_options not supported with a pyarrow FileSystem.z9filesystem must be a pyarrow or fsspec FileSystem, not a r#   Úrbz8storage_options passed with buffer, or non-supported URLF©Úis_textr1   )r   r   Ú
isinstanceÚ
FileSystemÚNotImplementedErrorÚspecÚAbstractFileSystemr)   ÚtypeÚ__name__r   Úfrom_uriÚ	TypeErrorÚArrowInvalidÚcoreÚ	url_to_fsr   r(   ÚosÚpathÚisdirr   Úhandle)
rF   Úfsr1   ÚmodeÚis_dirÚpath_or_handleÚpa_fsr5   ÚpaÚhandless
             r/   Ú_get_path_or_handlerP   U   s°  € ô $ DÓ)€NØ	€~Ü*¨<ÀÔIˆÜ+¨H¸XÔFˆØÐ¤¨B°×0@Ñ0@Ô!AÙÜ)ØNóð ð Ð¤J¨r°6·;±;×3QÑ3QÔ$RØäðÜ˜b›×*Ñ*Ð+ð-óð ô �^Ô$¨¨ØÐ"Ü+¨IÓ6ˆBÜ.¨|Ó<ˆEðØ%*×%5Ñ%5×%>Ñ%>¸tÓ%DÑ"��Nð ˆ:Ü/°Ó9ˆFØ!6 §¡×!6Ñ!6Øñ"Ø#2Ò#8°bñ"ÑˆB‘ñ 
¤&¨Ô"8¸DÀDºLô ÐSÓTÐTà€GáÙÜ�~¤sÔ+Ü—‘—‘˜nÔ-ô
 Ø˜D¨%Àô
ˆð ˆØ Ÿ™ˆØ˜7 BÐ&Ð&øô7 ˜rŸ™Ð/ò Ùðús   Â7E; Å;FÆFc                  ó0   — e Zd Zedd„«       Zdd„Zddd„Zy)	r   c                ó:   — t        | t        «      st        d«      ‚y )Nz+to_parquet only supports IO with DataFrames)r9   r   r)   )Údfs    r/   Úvalidate_dataframezBaseImpl.validate_dataframe•   s   € ä˜"œiÔ(ÜÐJÓKÐKð )ó    c                ó   — t        | «      ‚©Nr   )ÚselfrS   rF   ÚcompressionÚkwargss        r/   ÚwritezBaseImpl.writeš   ó   € Ü! $Ó'Ð'rU   Nc                ó   — t        | «      ‚rW   r   )rX   rF   ÚcolumnsrZ   s       r/   ÚreadzBaseImpl.read�   r\   rU   )rS   r   ÚreturnÚNone)rS   r   rW   )r`   r   )r?   Ú
__module__Ú__qualname__ÚstaticmethodrT   r[   r_   © rU   r/   r   r   ”   s    „ ØòLó ðLó(õ(rU   c                  óz   — e Zd Zdd„Z	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zdddej                  ddf	 	 	 	 	 	 	 d	d„Zy)
r%   c                ó<   — t        dd¬«       dd l}dd l}|| _        y )Nr#   z(pyarrow is required for parquet support.©Úextrar   )r   Úpyarrow.parquetÚ(pandas.core.arrays.arrow.extension_typesÚapi)rX   r#   Úpandass      r/   Ú__init__zPyArrowImpl.__init__¢   s!   € Ü"ØÐGõ	
ó 	ó 	8àˆ�rU   Nc                ó¤  — | j                  |«       d|j                  dd «      i}	|�||	d<    | j                  j                  j                  |fi |	¤Ž}
|j
                  rNdt        j                  |j
                  «      i}|
j                  j                  }i |¥|¥}|
j                  |«      }
t        |||d|d u¬«      \  }}}t        |t        j                  «      rmt        |d«      rat        |j                   t"        t$        f«      rAt        |j                   t$        «      r|j                   j'                  «       }n|j                   }	 |�- | j                  j(                  j*                  |
|f|||dœ|¤Ž n+ | j                  j(                  j,                  |
|f||dœ|¤Ž |�|j/                  «        y y # |�|j/                  «        w w xY w)	NÚschemaÚpreserve_indexÚPANDAS_ATTRSÚwb)r1   rJ   rK   Úname)rY   Úpartition_colsÚ
filesystem)rY   rv   )rT   Úpoprl   ÚTableÚfrom_pandasÚattrsÚjsonÚdumpsrp   ÚmetadataÚreplace_schema_metadatarP   r9   ÚioÚBufferedWriterÚhasattrrt   r(   ÚbytesÚdecodeÚparquetÚwrite_to_datasetÚwrite_tableÚclose)rX   rS   rF   rY   Úindexr1   ru   rv   rZ   Úfrom_pandas_kwargsÚtableÚdf_metadataÚexisting_metadataÚmerged_metadatarL   rO   s                   r/   r[   zPyArrowImpl.write­   sÕ  € ð 	×Ñ Ô#à.6¸¿
¹
À8ÈTÓ8RÐ-SÐØÐØ38ÐÐ/Ñ0à*�—‘—‘×*Ñ*¨2ÑDÐ1CÑDˆà�8Š8Ø)¬4¯:©:°b·h±hÓ+?Ð@ˆKØ %§¡× 5Ñ 5ÐØBÐ!2ÐB°kÐBˆOØ×1Ñ1°/ÓBˆEä.AØØØ+ØØ!¨Ð-ô/
Ñ+ˆ˜ ô �~¤r×'8Ñ'8Ô9Ü˜¨Ô/Ü˜>×.Ñ.´´e°Ô=ä˜.×-Ñ-¬uÔ5Ø!/×!4Ñ!4×!;Ñ!;Ó!=‘à!/×!4Ñ!4�ð	 ØÐ)à1�—‘× Ñ ×1Ñ1ØØ"ðð !,Ø#1Ø)ñð óð -�—‘× Ñ ×,Ñ,ØØ"ðð !,Ø)ñ	ð
 òð Ð"Ø—‘•ð #øˆwÐ"Ø—‘•ð #ús   ÅAF: Æ:GFc                óÐ  — d|d<   i }	|dk(  rddl m}
  |
«       }|j                  |	d<   n0|dk(  rt        j                  |	d<   nt        «       rt        «       |	d<   t        dd¬	«      }|d
k(  rd|	d<   t        |||d¬«      \  }}}	  | j                  j                  j                  |f|||dœ|¤Ž} |j                  di |	¤Ž}|d
k(  r|j                  d
d¬«      }|j                  j                  rKd|j                  j                  v r3|j                  j                  d   }t!        j"                  |«      |_        ||�|j'                  «        S S # |�|j'                  «        w w xY w)NTÚuse_pandas_metadataÚnumpy_nullabler   )Ú_arrow_dtype_mappingÚtypes_mapperr#   zmode.data_manager)ÚsilentÚarrayÚsplit_blocksr6   )r1   rJ   )r^   rv   ÚfiltersF)Úcopys   PANDAS_ATTRSre   )Úpandas.io._utilr‘   ÚgetÚpdÚ
ArrowDtyper   r   r	   rP   rl   r„   Ú
read_tableÚ	to_pandasÚ_as_managerrp   r}   r{   Úloadsrz   r‡   )rX   rF   r^   r–   Úuse_nullable_dtypesÚdtype_backendr1   rv   rZ   Úto_pandas_kwargsr‘   ÚmappingÚmanagerrL   rO   Úpa_tableÚresultr‹   s                     r/   r_   zPyArrowImpl.readï   s€  € ð )-ˆÐ$Ñ%àÐØÐ,Ò,Ý<á*Ó,ˆGØ/6¯{©{Ð˜^Ò,Ø˜iÒ'Ü/1¯}©}Ð˜^Ò,Ü'Ô)Ü/HÓ/JÐ˜^Ñ,äÐ1¸$Ô?ˆØ�gÒØ/3Ð˜^Ñ,ä.AØØØ+Øô	/
Ñ+ˆ˜ ð	 Ø2�t—x‘x×'Ñ'×2Ñ2ØðàØ%Øñ	ð
 ñˆHð (�X×'Ñ'Ñ;Ð*:Ñ;ˆFà˜'Ò!Ø×+Ñ+¨G¸%Ð+Ó@�à�‰×'Ò'Ø" h§o¡o×&>Ñ&>Ñ>Ø"*§/¡/×":Ñ":¸?Ñ"K�KÜ#'§:¡:¨kÓ#:�F”LØàÐ"Ø—‘•ð #øˆwÐ"Ø—‘•ð #ús   ÂB7E ÅE%©r`   ra   ©ÚsnappyNNNN)rS   r   rF   zFilePath | WriteBuffer[bytes]rY   ú
str | Nonerˆ   úbool | Noner1   úStorageOptions | Noneru   úlist[str] | Noner`   ra   )r    Úboolr¡   úDtypeBackend | lib.NoDefaultr1   r¬   r`   r   )r?   rb   rc   rn   r[   r
   Ú
no_defaultr_   re   rU   r/   r%   r%   ¡   s¯   „ ó	ð #+Ø!Ø15Ø+/Øð@ àð@ ð ,ð@ ð  ð	@ ð
 ð@ ð /ð@ ð )ð@ ð 
ó@ ðJ ØØ$)Ø69·n±nØ15Øð6 ð
 "ð6 ð 4ð6 ð /ð6 ð 
ô6 rU   r%   c                  óN   — e Zd Zdd„Z	 	 	 	 	 d	 	 	 	 	 	 	 dd„Z	 	 	 	 d	 	 	 d	d„Zy)
r&   c                ó,   — t        dd¬«      }|| _        y )Nr$   z,fastparquet is required for parquet support.rh   )r   rl   )rX   r$   s     r/   rn   zFastParquetImpl.__init__)  s   € ô 1ØÐ!Oô
ˆð ˆ�rU   Nc                ó”  ‡‡	— | j                  |«       d|v r|�t        d«      ‚d|v r|j                  d«      }|�d|d<   |�t        d«      ‚t	        |«      }t        |«      rt        d«      Š	ˆ	ˆfd„|d<   n‰rt        d	«      ‚t        d
¬«      5   | j                  j                  ||f|||dœ|¤Ž d d d «       y # 1 sw Y   y xY w)NÚpartition_onzYCannot use both partition_on and partition_cols. Use partition_cols for partitioning dataÚhiveÚfile_schemeú9filesystem is not implemented for the fastparquet engine.r5   c                óP   •—  ‰j                   | dfi ‰xs i ¤Žj                  «       S )Nrs   )Úopen)rF   Ú_r5   r1   s     €€r/   ú<lambda>z'FastParquetImpl.write.<locals>.<lambda>T  s.   ø€ °+°&·+±+Ø�dñ3Ø.Ò4°"ñ3ç‰d‹fð rU   Ú	open_withz?storage_options passed with file object or non-fsspec file pathT)Úrecord)rY   Úwrite_indexr´   )
rT   r)   rw   r;   r   r   r   r   rl   r[   )
rX   rS   rF   rY   rˆ   ru   r1   rv   rZ   r5   s
         `  @r/   r[   zFastParquetImpl.write1  s  ù€ ð 	×Ñ Ô#à˜VÑ#¨Ð(BÜðKóð ð ˜VÑ#Ø#ŸZ™Z¨Ó7ˆNàÐ%Ø$*ˆF�=Ñ!àÐ!Ü%ØKóð ô
 ˜dÓ#ˆÜ˜ÔÜ/°Ó9ˆFô#ˆF�;Òñ ÜØQóð ô  4Ô(ñ 	ØˆD�H‰H�N‰NØØðð (Ø!Ø+ñð ò÷	÷ 	ñ 	ús   Â#B>Â>Cc                óÄ  — i }|j                  dd«      }|j                  dt        j                  «      }	d|d<   |rt        d«      ‚|	t        j                  urt        d«      ‚|�t	        d«      ‚t        |«      }d }
t        |«      r1t        d«      } |j                  |d	fi |xs i ¤Žj                  |d
<   nJt        |t        «      r:t        j                  j                  |«      st        |d	d|¬«      }
|
j                   }	  | j"                  j$                  |fi |¤Ž} |j&                  d||dœ|¤Ž|
�|
j)                  «        S S # |
�|
j)                  «        w w xY w)Nr    Fr¡   Úpandas_nullszNThe 'use_nullable_dtypes' argument is not supported for the fastparquet enginezHThe 'dtype_backend' argument is not supported for the fastparquet enginer·   r5   r6   rI   r7   )r^   r–   re   )rw   r
   r°   r)   r;   r   r   r   r¹   rI   r9   r(   rE   rF   rG   r   rH   rl   ÚParquetFiler�   r‡   )rX   rF   r^   r–   r1   rv   rZ   Úparquet_kwargsr    r¡   rO   r5   Úparquet_files                r/   r_   zFastParquetImpl.readf  sm  € ð *,ˆØ$Ÿj™jÐ)>ÀÓFÐØŸ
™
 ?´C·N±NÓCˆà).ˆ�~Ñ&ÙÜð%óð ð ¤§¡Ñ.Üð%óð ð Ð!Ü%ØKóð ô ˜dÓ#ˆØˆÜ˜ÔÜ/°Ó9ˆFà#. 6§;¡;¨t°TÑ#U¸oÒ>SÐQSÑ#U×#XÑ#XˆN˜4Ò Ü˜œcÔ"¬2¯7©7¯=©=¸Ô+>ô !Ø�d E¸?ôˆGð —>‘>ˆDð	 Ø/˜4Ÿ8™8×/Ñ/°ÑG¸ÑGˆLØ)�<×)Ñ)ÐU°'À7ÑUÈfÑUàÐ"Ø—‘•ð #øˆwÐ"Ø—‘•ð #ús   Ä1E
 Å
Er§   r¨   )rS   r   rY   z*Literal['snappy', 'gzip', 'brotli'] | Noner1   r¬   r`   ra   )NNNN)r1   r¬   r`   r   )r?   rb   rc   rn   r[   r_   re   rU   r/   r&   r&   (  sn   „ óð CKØØØ15Øð3àð3ð @ð	3ð /ð3ð 
ó3ðp ØØ15Øð0 ð
 /ð0 ð 
ô0 rU   r&   )r1   r!   c           	     ó   — t        |t        «      r|g}t        |«      }	|€t        j                  «       n|}
 |	j
                  | |
f|||||dœ|¤Ž |€,t        |
t        j                  «      sJ ‚|
j                  «       S y)a†	  
    Write a DataFrame to the parquet format.

    Parameters
    ----------
    df : DataFrame
    path : str, path object, file-like object, or None, default None
        String, path object (implementing ``os.PathLike[str]``), or file-like
        object implementing a binary ``write()`` function. If None, the result is
        returned as bytes. If a string, it will be used as Root Directory path
        when writing a partitioned dataset. The engine fastparquet does not
        accept file-like objects.
    engine : {{'auto', 'pyarrow', 'fastparquet'}}, default 'auto'
        Parquet library to use. If 'auto', then the option
        ``io.parquet.engine`` is used. The default ``io.parquet.engine``
        behavior is to try 'pyarrow', falling back to 'fastparquet' if
        'pyarrow' is unavailable.

        When using the ``'pyarrow'`` engine and no storage options are provided
        and a filesystem is implemented by both ``pyarrow.fs`` and ``fsspec``
        (e.g. "s3://"), then the ``pyarrow.fs`` filesystem is attempted first.
        Use the filesystem keyword with an instantiated fsspec filesystem
        if you wish to use its implementation.
    compression : {{'snappy', 'gzip', 'brotli', 'lz4', 'zstd', None}},
        default 'snappy'. Name of the compression to use. Use ``None``
        for no compression.
    index : bool, default None
        If ``True``, include the dataframe's index(es) in the file output. If
        ``False``, they will not be written to the file.
        If ``None``, similar to ``True`` the dataframe's index(es)
        will be saved. However, instead of being saved as values,
        the RangeIndex will be stored as a range in the metadata so it
        doesn't require much space and is faster. Other indexes will
        be included as columns in the file output.
    partition_cols : str or list, optional, default None
        Column names by which to partition the dataset.
        Columns are partitioned in the order they are given.
        Must be None if path is not a string.
    {storage_options}

    filesystem : fsspec or pyarrow filesystem, default None
        Filesystem object to use when reading the parquet file. Only implemented
        for ``engine="pyarrow"``.

        .. versionadded:: 2.1.0

    kwargs
        Additional keyword arguments passed to the engine

    Returns
    -------
    bytes if no path argument is provided else None
    N)rY   rˆ   ru   r1   rv   )r9   r(   r0   r   ÚBytesIOr[   Úgetvalue)rS   rF   r*   rY   rˆ   r1   ru   rv   rZ   ÚimplÚpath_or_bufs              r/   Ú
to_parquetrÉ   ™  s”   € ôB �.¤#Ô&Ø(Ð)ˆÜ�fÓ€DàAEÀ´·±´ÐSW€Kà€D‡J�JØ
Øð	ð  ØØ%Ø'Øñ	ð ò	ð €|Ü˜+¤r§z¡zÔ2Ð2Ð2Ø×#Ñ#Ó%Ð%àrU   c           
     óê   — t        |«      }	|t        j                  ur0d}
|du r|
dz  }
t        j                  |
t
        t        «       ¬«       nd}t        |«        |	j                  | f||||||dœ|¤ŽS )a¢  
    Load a parquet object from the file path, returning a DataFrame.

    Parameters
    ----------
    path : str, path object or file-like object
        String, path object (implementing ``os.PathLike[str]``), or file-like
        object implementing a binary ``read()`` function.
        The string could be a URL. Valid URL schemes include http, ftp, s3,
        gs, and file. For file URLs, a host is expected. A local file could be:
        ``file://localhost/path/to/table.parquet``.
        A file URL can also be a path to a directory that contains multiple
        partitioned parquet files. Both pyarrow and fastparquet support
        paths to directories as well as file URLs. A directory path could be:
        ``file://localhost/path/to/tables`` or ``s3://bucket/partition_dir``.
    engine : {{'auto', 'pyarrow', 'fastparquet'}}, default 'auto'
        Parquet library to use. If 'auto', then the option
        ``io.parquet.engine`` is used. The default ``io.parquet.engine``
        behavior is to try 'pyarrow', falling back to 'fastparquet' if
        'pyarrow' is unavailable.

        When using the ``'pyarrow'`` engine and no storage options are provided
        and a filesystem is implemented by both ``pyarrow.fs`` and ``fsspec``
        (e.g. "s3://"), then the ``pyarrow.fs`` filesystem is attempted first.
        Use the filesystem keyword with an instantiated fsspec filesystem
        if you wish to use its implementation.
    columns : list, default=None
        If not None, only these columns will be read from the file.
    {storage_options}

        .. versionadded:: 1.3.0

    use_nullable_dtypes : bool, default False
        If True, use dtypes that use ``pd.NA`` as missing value indicator
        for the resulting DataFrame. (only applicable for the ``pyarrow``
        engine)
        As new dtypes are added that support ``pd.NA`` in the future, the
        output with this option will change to use those dtypes.
        Note: this is an experimental option, and behaviour (e.g. additional
        support dtypes) may change without notice.

        .. deprecated:: 2.0

    dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
        Back-end data type applied to the resultant :class:`DataFrame`
        (still experimental). Behaviour is as follows:

        * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
          (default).
        * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
          DataFrame.

        .. versionadded:: 2.0

    filesystem : fsspec or pyarrow filesystem, default None
        Filesystem object to use when reading the parquet file. Only implemented
        for ``engine="pyarrow"``.

        .. versionadded:: 2.1.0

    filters : List[Tuple] or List[List[Tuple]], default None
        To filter out data.
        Filter syntax: [[(column, op, val), ...],...]
        where op is [==, =, >, >=, <, <=, !=, in, not in]
        The innermost tuples are transposed into a set of filters applied
        through an `AND` operation.
        The outer list combines these sets of filters through an `OR`
        operation.
        A single list of tuples can also be used, meaning that no `OR`
        operation between set of filters is to be conducted.

        Using this argument will NOT result in row-wise filtering of the final
        partitions unless ``engine="pyarrow"`` is also specified.  For
        other engines, filtering is only performed at the partition level, that is,
        to prevent the loading of some row-groups and/or files.

        .. versionadded:: 2.1.0

    **kwargs
        Any additional kwargs are passed to the engine.

    Returns
    -------
    DataFrame

    See Also
    --------
    DataFrame.to_parquet : Create a parquet object that serializes a DataFrame.

    Examples
    --------
    >>> original_df = pd.DataFrame(
    ...     {{"foo": range(5), "bar": range(5, 10)}}
    ...    )
    >>> original_df
       foo  bar
    0    0    5
    1    1    6
    2    2    7
    3    3    8
    4    4    9
    >>> df_parquet_bytes = original_df.to_parquet()
    >>> from io import BytesIO
    >>> restored_df = pd.read_parquet(BytesIO(df_parquet_bytes))
    >>> restored_df
       foo  bar
    0    0    5
    1    1    6
    2    2    7
    3    3    8
    4    4    9
    >>> restored_df.equals(original_df)
    True
    >>> restored_bar = pd.read_parquet(BytesIO(df_parquet_bytes), columns=["bar"])
    >>> restored_bar
        bar
    0    5
    1    6
    2    7
    3    8
    4    9
    >>> restored_bar.equals(original_df[['bar']])
    True

    The function uses `kwargs` that are passed directly to the engine.
    In the following example, we use the `filters` argument of the pyarrow
    engine to filter the rows of the DataFrame.

    Since `pyarrow` is the default engine, we can omit the `engine` argument.
    Note that the `filters` argument is implemented by the `pyarrow` engine,
    which can benefit from multithreading and also potentially be more
    economical in terms of memory.

    >>> sel = [("foo", ">", 2)]
    >>> restored_part = pd.read_parquet(BytesIO(df_parquet_bytes), filters=sel)
    >>> restored_part
        foo  bar
    0    3    8
    1    4    9
    zYThe argument 'use_nullable_dtypes' is deprecated and will be removed in a future version.TzFUse dtype_backend='numpy_nullable' instead of use_nullable_dtype=True.)Ú
stacklevelF)r^   r–   r1   r    r¡   rv   )	r0   r
   r°   ÚwarningsÚwarnÚFutureWarningr   r   r_   )rF   r*   r^   r1   r    r¡   rv   r–   rZ   rÇ   Úmsgs              r/   Úread_parquetrÐ   ò  s—   € ôr �fÓ€Dà¤#§.¡.Ñ0ð#ð 	ð  $Ñ&ØØXñˆCô 	�‰�cœ=Ô5EÓ5GÖHà#ÐÜ˜Ô&àˆ4�9‰9Øð	àØØ'Ø/Ø#Øñ	ð ñ	ð 	rU   )r*   r(   r`   r   )Nr6   F)rF   z1FilePath | ReadBuffer[bytes] | WriteBuffer[bytes]rI   r   r1   r¬   rJ   r(   rK   r®   r`   zVtuple[FilePath | ReadBuffer[bytes] | WriteBuffer[bytes], IOHandles[bytes] | None, Any])Nr!   r©   NNNN)rS   r   rF   z$FilePath | WriteBuffer[bytes] | Noner*   r(   rY   rª   rˆ   r«   r1   r¬   ru   r­   rv   r   r`   zbytes | None)rF   zFilePath | ReadBuffer[bytes]r*   r(   r^   r­   r1   r¬   r    zbool | lib.NoDefaultr¡   r¯   rv   r   r–   z&list[tuple] | list[list[tuple]] | Noner`   r   )8Ú__doc__Ú
__future__r   r   r{   rE   Útypingr   r   r   rÌ   r   Úpandas._configr   Úpandas._config.configr	   Úpandas._libsr
   Úpandas.compat._optionalr   Úpandas.errorsr   Úpandas.util._decoratorsr   Úpandas.util._exceptionsr   Úpandas.util._validatorsr   rm   rš   r   r   Úpandas.core.shared_docsr   r˜   r   Úpandas.io.commonr   r   r   r   r   Úpandas._typingr   r   r   r   r   r0   rP   r   r%   r&   rÉ   r°   rÐ   re   rU   r/   ú<module>rß      s  ðÙ Ý "ã 	Û Û 	÷ñ ó
 Ý #å 5Ý -å Ý >Ý -Ý 'Ý 4Ý 7ã ÷õ 1å 5÷õ ñ ÷õ óGðJ .2ØØð<'Ø
;ð<'àð<'ð +ð<'ð ð	<'ð
 ð<'ðó<'÷~
(ñ 
(ôD �(ô D ôNn �hô n ñb �\Ð"3Ñ4Ô5ð 26ØØ&ØØ-1Ø'+ØðUØðUà
.ðUð ðUð ð	Uð
 ðUð +ðUð %ðUð ðUð òUó 6ðUñp �\Ð"3Ñ4Ô5ð Ø $Ø-1Ø03·±Ø25·.±.ØØ6:ðqØ
&ðqàðqð ðqð +ð	qð
 .ðqð 0ðqð ðqð 4ðqð òqó 6ñqrU   