
    Pi                       d Z ddlmZ ddl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 erddlmZmZ ddlmZmZmZm Z m!Z! 	 d%d&dZ" ed          ddde
j#        fd'd$            Z$dS )(zfeather-format compat    )annotations)TYPE_CHECKINGAnyN)using_string_dtype)lib)import_optional_dependency)Pandas4Warning)
set_module)check_dtype_backend)	DataFrame)arrow_table_to_pandas)
get_handle)HashableSequence)DtypeBackendFilePath
ReadBufferStorageOptionsWriteBufferdfr   pathFilePath | WriteBuffer[bytes]storage_optionsStorageOptions | Nonekwargsr   returnNonec                    t          d           ddlm} t          | t                    st          d          t          |d|d          5 } |j        | |j        fi | ddd           dS # 1 swxY w Y   dS )	at  
    Write a DataFrame to the binary Feather format.

    Parameters
    ----------
    df : DataFrame
    path : str, path object, or file-like object
    storage_options : dict, optional
        Extra options that make sense for a particular storage connection, e.g.
        host, port, username, password, etc. For HTTP(S) URLs the key-value pairs
        are forwarded to ``urllib.request.Request`` as header options. For other
        URLs (e.g. starting with "s3://", and "gcs://") the key-value pairs are
        forwarded to ``fsspec.open``. Please see ``fsspec`` and ``urllib`` for more
        details, and for more examples on storage options refer `here
        <https://pandas.pydata.org/docs/user_guide/io.html?
        highlight=storage_options#reading-writing-remote-files>`_.
    **kwargs :
        Additional keywords passed to `pyarrow.feather.write_feather`.

    pyarrowr   featherz'feather only support IO with DataFrameswbFr   is_textN)	r   r   r!   
isinstancer   
ValueErrorr   write_featherhandle)r   r   r   r   r!   handless         l/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/pandas/io/feather_format.py
to_featherr+   '   s    4 y)))b)$$ DBCCC	dOU
 
 
 <	b'.;;F;;;< < < < < < < < < < < < < < < < < <s   A//A36A3pandasTFilePath | ReadBuffer[bytes]columnsSequence[Hashable] | Noneuse_threadsbooldtype_backendDtypeBackend | lib.NoDefaultc           	     R   t          d           ddlm} ddl}t	          |           t          | d|d          5 }|t          j        u rt                      s|t          j
                    5  t          j        dd	t                     |                    |j        |t          |          
          cddd           cddd           S # 1 swxY w Y   |                    |j        |t          |          
          }t#          ||          cddd           S # 1 swxY w Y   dS )a  
    Load a feather-format object from the file path.

    Feather is particularly useful for scenarios that require efficient
    serialization and deserialization of tabular data. It supports
    schema preservation, making it a reliable choice for use cases
    such as sharing data between Python and R, or persisting intermediate
    results during data processing pipelines. This method provides additional
    flexibility with options for selective column reading, thread parallelism,
    and choosing the backend for data types.

    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.feather``.
    columns : sequence, default None
        If not provided, all columns are read.
    use_threads : bool, default True
        Whether to parallelize reading using multiple threads.
    storage_options : dict, optional
        Extra options that make sense for a particular storage connection, e.g.
        host, port, username, password, etc. For HTTP(S) URLs the key-value pairs
        are forwarded to ``urllib.request.Request`` as header options. For other
        URLs (e.g. starting with "s3://", and "gcs://") the key-value pairs are
        forwarded to ``fsspec.open``. Please see ``fsspec`` and ``urllib`` for more
        details, and for more examples on storage options refer `here
        <https://pandas.pydata.org/docs/user_guide/io.html?
        highlight=storage_options#reading-writing-remote-files>`_.

    dtype_backend : {{'numpy_nullable', 'pyarrow'}}
        Back-end data type applied to the resultant :class:`DataFrame`
        (still experimental). If not specified, the default behavior
        is to not use nullable data types. If specified, the behavior
        is as follows:

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

        .. versionadded:: 2.0

    Returns
    -------
    type of object stored in file
        DataFrame object stored in the file.

    See Also
    --------
    read_csv : Read a comma-separated values (csv) file into a pandas DataFrame.
    read_excel : Read an Excel file into a pandas DataFrame.
    read_spss : Read an SPSS file into a pandas DataFrame.
    read_orc : Load an ORC object into a pandas DataFrame.
    read_sas : Read SAS file into a pandas DataFrame.

    Examples
    --------
    >>> df = pd.read_feather("path/to/file.feather")  # doctest: +SKIP
    r   r   r    NrbFr#   ignorezmake_block is deprecated)r.   r0   )r2   )r   r   r!   (pandas.core.arrays.arrow.extension_typesr   r   r   
no_defaultr   warningscatch_warningsfilterwarningsr	   read_featherr(   r1   
read_tabler   )	r   r.   r0   r   r2   r!   r,   r)   pa_tables	            r*   r<   r<   M   s	   J y))) 4333&&&	dOU
 
 
 L	CN**3E3G3G*(** 	 	'."   ++NGkARAR ,  	 	 	 	 	 	 		L L L L L L L L	 	 	 	 	 	 	 	 %%NGk9J9J & 
 
 %X]KKK%L L L L L L L L L L L L L L L L L Ls6   0D,AC
1D
C	DC	=DD #D )N)
r   r   r   r   r   r   r   r   r   r   )r   r-   r.   r/   r0   r1   r   r   r2   r3   r   r   )%__doc__
__future__r   typingr   r   r9   pandas._configr   pandas._libsr   pandas.compat._optionalr   pandas.errorsr	   pandas.util._decoratorsr
   pandas.util._validatorsr   pandas.core.apir   pandas.io._utilr   pandas.io.commonr   collections.abcr   r   pandas._typingr   r   r   r   r   r+   r8   r<        r*   <module>rO      s     " " " " " "         - - - - - -       > > > > > > ( ( ( ( ( ( . . . . . . 7 7 7 7 7 7 % % % % % % 1 1 1 1 1 1 ' ' ' ' ' '        
              .2#< #< #< #< #<L H *.-125.^L ^L ^L ^L ^L ^L ^LrN   