
    Mh                     N   S r SSKJr  SSKrSSKJr  SSKJrJrJ	r	  SSK
Jr  SSKJr  SSKJr  SS	KJr  SSKrSS
KJr  SSKJr  SSKJrJr  \(       a  SSKrSSKrSSKJrJ r J!r!J"r"  SSK#J$r$  S\RJ                  S4           SS jjr& SSSSS.           SS jjjr'g)zorc compat     )annotationsN)
ModuleType)TYPE_CHECKINGAnyLiteral)using_pyarrow_string_dtype)lib)import_optional_dependency)check_dtype_backend)default_index)arrow_string_types_mapper)
get_handleis_fsspec_url)DtypeBackendFilePath
ReadBufferWriteBuffer)	DataFramec                   [        S5      n[        U5        [        U SSS9 nUR                  n[	        U 5      (       a7  Uc4  [        S5      n[        S5      n	 U	R
                  R                  U 5      u  p7UR                  " SXqUS.UD6n
SSS5        U[        R                  LaM  US:X  a  W
R                  [        R                  S	9nU$ S
SKJn  U" 5       nW
R                  UR"                  S	9nU$ [%        5       (       a  ['        5       nOSnW
R                  US	9$ ! [        UR                  4 a     Nf = f! , (       d  f       N= f)a5  
Load an ORC 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, and file. For file URLs, a host is
    expected. A local file could be:
    ``file://localhost/path/to/table.orc``.
columns : list, default None
    If not None, only these columns will be read from the file.
    Output always follows the ordering of the file and not the columns list.
    This mirrors the original behaviour of
    :external+pyarrow:py:meth:`pyarrow.orc.ORCFile.read`.
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.

    .. versionadded:: 2.1.0

**kwargs
    Any additional kwargs are passed to pyarrow.

Returns
-------
DataFrame

Notes
-----
Before using this function you should read the :ref:`user guide about ORC <io.orc>`
and :ref:`install optional dependencies <install.warn_orc>`.

If ``path`` is a URI scheme pointing to a local or remote file (e.g. "s3://"),
a ``pyarrow.fs`` filesystem will be attempted to read the file. You can also pass a
pyarrow or fsspec filesystem object into the filesystem keyword to override this
behavior.

Examples
--------
>>> result = pd.read_orc("example_pa.orc")  # doctest: +SKIP
pyarrow.orcrbFis_textNpyarrowz
pyarrow.fs)sourcecolumns
filesystem)types_mapperr   )_arrow_dtype_mapping )r
   r   r   handler   
FileSystemfrom_uri	TypeErrorArrowInvalid
read_tabler	   
no_default	to_pandaspd
ArrowDtypepandas.io._utilr   getr   r   )pathr   dtype_backendr   kwargsorchandlesr   papa_fspa_tabledfr   mappingr   s                  ?/var/www/html/env/lib/python3.13/site-packages/pandas/io/orc.pyread_orcr8   )   sD   | %]
3C&	D$	.':#5+I6B.|<E%*%5%5%>%>t%D"
 >> 
z
EK
 
/ CNN*I%###?B 		 =*,G###=B	%''46LL!!|!<<) r/  
/	.s/   6D:D6D:D74D:6D77D::
Er   )engineindexengine_kwargsc               ^   Uc  U R                   R                  S   SLnUc  0 nU R                   R                  [        [	        U 5      5      5      (       d  [        S5      eU R                   R                  b  [        S5      eUS:w  a  [        S5      e[        USS9n[        S5      n[        S	5      nUSL nU(       a  [        R                  " 5       nUc   e[        US
SS9 n[        U[        5      (       d   e UR                  " UR                  R                  XS9UR                   40 UD6   SSS5        U(       a1  [        U[        R                  5      (       d   eUR)                  5       $ g! ["        UR$                  4 a  n	['        S5      U	eSn	A	ff = f! , (       d  f       Nq= f)a  
Write a DataFrame to the ORC format.

.. versionadded:: 1.5.0

Parameters
----------
df : DataFrame
    The dataframe to be written to ORC. Raises NotImplementedError
    if dtype of one or more columns is category, unsigned integers,
    intervals, periods or sparse.
path : str, file-like object or None, default None
    If a string, it will be used as Root Directory path
    when writing a partitioned dataset. By file-like object,
    we refer to objects with a write() method, such as a file handle
    (e.g. via builtin open function). If path is None,
    a bytes object is returned.
engine : str, default 'pyarrow'
    ORC library to use.
index : bool, optional
    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 ``infer`` 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.
engine_kwargs : dict[str, Any] or None, default None
    Additional keyword arguments passed to :func:`pyarrow.orc.write_table`.

Returns
-------
bytes if no path argument is provided else None

Raises
------
NotImplementedError
    Dtype of one or more columns is category, unsigned integers, interval,
    period or sparse.
ValueError
    engine is not pyarrow.

Notes
-----
* Before using this function you should read the
  :ref:`user guide about ORC <io.orc>` and
  :ref:`install optional dependencies <install.warn_orc>`.
* This function requires `pyarrow <https://arrow.apache.org/docs/python/>`_
  library.
* For supported dtypes please refer to `supported ORC features in Arrow
  <https://arrow.apache.org/docs/cpp/orc.html#data-types>`__.
* Currently timezones in datetime columns are not preserved when a
  dataframe is converted into ORC files.
Nr   z{orc does not support serializing a non-default index for the index; you can .reset_index() to make the index into column(s)z9orc does not serialize index meta-data on a default indexr   zengine must be 'pyarrow'z10.0.1)min_versionr   wbFr   )preserve_indexz6The dtype of one or more columns is not supported yet.)r:   namesequalsr   len
ValueErrornamer
   ioBytesIOr   
isinstancer   write_tableTablefrom_pandasr!   r$   ArrowNotImplementedErrorNotImplementedErrorgetvalue)
r5   r-   r9   r:   r;   r2   r0   was_noner1   es
             r7   to_orcrP      s   | }q!- 88??=R122F
 	

 
xx}} TUU344'HEF	#I	.B
$]
3Ct|Hzz|	D$	.'&*----		OO(((B   
/ $

++++}} 2667 	%H	 
/	.s*   $F=5E44F
FFF
F,)r-   zFilePath | ReadBuffer[bytes]r   zlist[str] | Noner.   zDtypeBackend | lib.NoDefaultr   z=pyarrow.fs.FileSystem | fsspec.spec.AbstractFileSystem | Noner/   r   returnr   )N)r5   r   r-   z$FilePath | WriteBuffer[bytes] | Noner9   zLiteral['pyarrow']r:   zbool | Noner;   zdict[str, Any] | NonerQ   zbytes | None)(__doc__
__future__r   rE   typesr   typingr   r   r   pandas._configr   pandas._libsr	   pandas.compat._optionalr
   pandas.util._validatorsr   pandasr)   pandas.core.indexes.apir   r+   r   pandas.io.commonr   r   fsspec
pyarrow.fsr   pandas._typingr   r   r   r   pandas.core.framer   r'   r8   rP   r        r7   <module>rb      s     " 	   6  > 7  1 5
   ,
 !%25..PT	]=
&]=]= 0]= N	]=
 ]= ]=D 26l "++/ll
.l 	l
 l )l lra   