o
    ÂôjÇF  ã                   @   sî  d Z ddlZddlZddlZddlZddl	Z
ddlZzddlmZ W n& eyH   zddlZdd„ Zejded�ZW n eyE   dZY nw Y nw e ¡ Ze ¡  ddlmZ er]e ¡  dd	lmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z( d
d„ Z)dd„ Z*dd„ Z+dd„ Z,ddlm-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`maZambZbmcZcmdZdmeZemfZfmgZgmhZhmiZimjZjmkZkmlZlmmZmmnZnmoZompZpmqZqmrZrmsZsmtZtmuZumvZvmwZwmxZxmyZymzZzm{Z{m|Z|m}Z}m~Z~mZm€Z€m�Z�m‚Z‚mƒZƒm„Z„m…Z…m†Z†m‡Z‡mˆZˆm‰Z‰mŠZŠm‹Z‹mŒZŒm�Z�mŽZŽm�Z�m�Z�m‘Z‘m’Z’m“Z“m”Z”m•Z•m–Z–m—Z—m˜Z˜m™Z™mšZšm›Z›mœZœm�Z�mžZžmŸZŸm Z m¡Z¡m¢Z¢m£Z£m¤Z¤m¥Z¥m¦Z¦m§Z§m¨Z¨m©Z©mªZªm«Z«m¬Z¬m­Z­m®Z®m¯Z¯m°Z°m±Z±m²Z²m³Z³m´Z´mµZµm¶Z¶m·Z·m¸Z¸m¹Z¹mºZºm»Z»m¼Z¼m½Z½m¾Z¿mÀZÀmÁZÁmÂZÂmÃZÃmÄZÄmÅZÅmÆZÆmÇZÇmÈZÈmÉZÉmÊZÊmËZËmÌZÌmÍZÍmÎZÎmÏZÏmÐZÐmÑZÑmÒZÒmÓZÓmÔZÔmÕZÕmÖZÖm×Z×mØZØmÙZÙmÚZÚmÛZÛmÜZÜmÝZÝmÞZÞmßZßmàZàmáZámâZâmãZãmäZämåZåmæZæmçZçmèZèméZémêZêmëZëmìZì ddlmíZímîZîmïZïmðZð ddlmñZñmòZòmóZómôZômõZõmöZöm÷Z÷møZø ddlmùZùmúZúmûZûmüZümýZýmþZþmÿZÿ�m �Z �m�Z�m�Z�m�Z�m�Z�m�Z�m�Z ddl�m�Z�m�Z�m	�Z	�m
�Z
�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z ddl�m�Z�m�Z�m�Z�m�Z�m�Z�m �Z �m!�Z!�m"�Z" ddl�m#�Z#�m$�Z$�m%�Z%�m&�Z&�m'�Z'�m(�Z(�m)�Z)�m*�Z*�m+�Z+�m,�Z,�m-�Z- dd�l.�m/�Z/�m0�Z0 dd�l.�m1�Z1 dd�l2�m3�Z3 dd�l4�m5�Z5�m6�Z6 dd�l.�m7�Z7�m8�Z8�m9�Z9�m:�Z:�m;�Z;�m<�Z<�m=�Z= dd„ �Z>dd„ �Z?d d!„ �Z@d"d#„ �ZAd$d%„ �ZBd&d'„ �ZCd(d)„ �ZDdS )*aÝ  
PyArrow is the python implementation of Apache Arrow.

Apache Arrow is a cross-language development platform for in-memory data.
It specifies a standardized language-independent columnar memory format for
flat and hierarchical data, organized for efficient analytic operations on
modern hardware. It also provides computational libraries and zero-copy
streaming messaging and interprocess communication.

For more information see the official page at https://arrow.apache.org
é    Né   )Úversionc                 K   s$   ddl m} d|d< || fi |¤ŽS )z‘
            Parse function for setuptools_scm that ignores tags for non-C++
            subprojects, e.g. apache-arrow-js-XXX tags.
            r   ©ÚparsezBgit describe --dirty --tags --long --match 'apache-arrow-[0-9]*.*'Zdescribe_command)Zsetuptools_scm.gitr   )ÚrootÚkwargsr   © r   úc/var/www/html/academy/tools/voices/clone/cosy-venv/lib/python3.10/site-packages/pyarrow/__init__.pyÚ	parse_git/   s   ÿr
   z../r   )Ú	BuildInfoÚRuntimeInfoÚset_timezone_db_pathÚMonthDayNanoÚVersionInfoÚcpp_build_infoÚcpp_versionÚcpp_version_infoÚruntime_infoÚ	cpu_countÚset_cpu_countÚenable_signal_handlersÚio_thread_countÚset_io_thread_countc                  C   s†   dd„ } t dƒ | dttjƒdkrtjndƒ | dtjƒ | dtj› d	tj› �ƒ | d
tjƒ | dtjƒ | dtj	ƒ | dtj
ƒ dS )zJ
    Print various version information, to help with error reporting.
    c                 S   s   t | d›d|d›�ƒ d S )Nz <26ú: ú <8©Úprint©ÚlabelÚvaluer   r   r	   Úprint_entryP   ó   z"show_versions.<locals>.print_entryz)pyarrow version info
--------------------zPackage kindr   znot indicatedzArrow C++ library versionzArrow C++ compilerú zArrow C++ compiler flagszArrow C++ git revisionzArrow C++ git descriptionzArrow C++ build typeN)r   Úlenr   Zpackage_kindr   Zcompiler_idZcompiler_versionZcompiler_flagsZgit_idZgit_descriptionZ
build_type)r    r   r   r	   Úshow_versionsL   s   ÿþÿr$   c                 C   s,   zt  d| › �¡ W dS  ty   Y dS w )Nzpyarrow.FT)Ú
_importlibÚimport_moduleÚImportError)Úmoduler   r   r	   Ú_module_is_available`   s   ýÿr)   c              	   C   sN   zdd l }W n
 ty   Y dS w z	t|j| ƒ W dS  ttfy&   Y dS w )Nr   FT)Z
pyarrow.fsr'   ÚgetattrÚfsÚAttributeError)r+   Úpyarrowr   r   r	   Ú_filesystem_is_availablei   s   ÿýÿr.   c            	      C   sn  t ƒ  dd„ } tdƒ | dt ¡ › dt ¡ › �ƒ | dtƒ jƒ | dtƒ jƒ tƒ }tdƒ | d	|j	ƒ | d
| 
¡ › d�ƒ | d| ¡ › d�ƒ | dd tƒ ¡ƒ tdƒ g d¢}|D ]}t|ƒrcdnd}td|d›d|d›�ƒ q[tdƒ g d¢}|D ]}t|ƒr„dnd}td|d›d|d›�ƒ q|tdƒ g d¢}|D ]}t |¡r¦dnd}td|d›d|d›�ƒ q�dS )zN
    Print detailed version and platform information, for error reporting
    c                 S   s   t d| d›d|d›�ƒ d S )Nú  ú <20r   r   r   r   r   r   r	   r    }   s   zshow_info.<locals>.print_entryz

Platform:z	OS / Archr"   z
SIMD LevelzDetected SIMD Levelz
Memory:zDefault backendzBytes allocatedz bytesz
Max memoryzSupported Backendsz, z
Optional modules:)
ÚcsvÚcudaÚdatasetZfeatherZflightr+   ZgandivaÚjsonZorcÚparquetZEnabledú-r/   r0   r   r   z
Filesystems:)ZAzureFileSystemZGcsFileSystemZHadoopFileSystemZS3FileSystemz
Compression Codecs:)ÚbrotliÚbz2ÚgzipZ	lz4_frameÚlz4ZsnappyÚzstdN)r$   r   Ú	_platformÚsystemÚmachiner   Z
simd_levelZdetected_simd_levelÚdefault_memory_poolÚbackend_nameZbytes_allocatedÚ
max_memoryÚjoinÚsupported_memory_backendsr)   r.   ÚCodecÚis_available)	r    ÚpoolÚmodulesr(   ÚstatusZfilesystemsr+   ÚcodecsÚcodecr   r   r	   Ú	show_infow   s8   þrK   )¿ÚnullÚbool_Úint8Úint16Úint32Úint64Úuint8Úuint16Úuint32Úuint64Útime32Útime64Ú	timestampÚdate32Údate64ÚdurationÚmonth_day_nano_intervalÚfloat16Úfloat32Úfloat64ÚbinaryÚstringÚutf8Úbinary_viewÚstring_viewÚlarge_binaryÚlarge_stringÚ
large_utf8Ú
decimal128Ú
decimal256Úlist_Ú
large_listÚ	list_viewÚlarge_list_viewÚmap_ÚstructÚunionÚsparse_unionÚdense_unionÚ
dictionaryÚrun_end_encodedÚbool8Úfixed_shape_tensorÚopaqueÚuuidÚfieldÚtype_for_aliasÚDataTypeÚDictionaryTypeÚ
StructTypeÚListTypeÚLargeListTypeÚFixedSizeListTypeÚListViewTypeÚLargeListViewTypeÚMapTypeÚ	UnionTypeÚSparseUnionTypeÚDenseUnionTypeÚTimestampTypeÚ
Time32TypeÚ
Time64TypeÚDurationTypeÚFixedSizeBinaryTypeÚDecimal128TypeÚDecimal256TypeÚBaseExtensionTypeÚExtensionTypeÚRunEndEncodedTypeÚ	Bool8TypeÚFixedShapeTensorTypeÚ
OpaqueTypeÚUuidTypeÚPyExtensionTypeÚUnknownExtensionTypeÚregister_extension_typeÚunregister_extension_typeÚDictionaryMemoÚKeyValueMetadataÚFieldÚSchemaÚschemaÚunify_schemasÚArrayÚTensorÚarrayÚchunked_arrayÚrecord_batchÚnullsÚrepeatÚSparseCOOTensorÚSparseCSRMatrixÚSparseCSCMatrixÚSparseCSFTensorÚ
infer_typeÚfrom_numpy_dtypeÚ	NullArrayÚNumericArrayÚIntegerArrayÚFloatingPointArrayÚBooleanArrayÚ	Int8ArrayÚ
UInt8ArrayÚ
Int16ArrayÚUInt16ArrayÚ
Int32ArrayÚUInt32ArrayÚ
Int64ArrayÚUInt64ArrayÚHalfFloatArrayÚ
FloatArrayÚDoubleArrayÚ	ListArrayÚLargeListArrayÚFixedSizeListArrayÚListViewArrayÚLargeListViewArrayÚMapArrayÚ
UnionArrayÚBinaryArrayÚStringArrayÚLargeBinaryArrayÚLargeStringArrayÚBinaryViewArrayÚStringViewArrayÚFixedSizeBinaryArrayÚDictionaryArrayÚDate32ArrayÚDate64ArrayÚTimestampArrayÚTime32ArrayÚTime64ArrayÚDurationArrayÚMonthDayNanoIntervalArrayÚDecimal128ArrayÚDecimal256ArrayÚStructArrayÚExtensionArrayÚRunEndEncodedArrayÚ
Bool8ArrayÚFixedShapeTensorArrayÚOpaqueArrayÚ	UuidArrayÚscalarÚNAÚ_NULLÚScalarÚ
NullScalarÚBooleanScalarÚ
Int8ScalarÚInt16ScalarÚInt32ScalarÚInt64ScalarÚUInt8ScalarÚUInt16ScalarÚUInt32ScalarÚUInt64ScalarÚHalfFloatScalarÚFloatScalarÚDoubleScalarÚDecimal128ScalarÚDecimal256ScalarÚ
ListScalarÚLargeListScalarÚFixedSizeListScalarÚListViewScalarÚLargeListViewScalarÚDate32ScalarÚDate64ScalarÚTime32ScalarÚTime64ScalarÚTimestampScalarÚDurationScalarÚMonthDayNanoIntervalScalarÚBinaryScalarÚLargeBinaryScalarÚBinaryViewScalarÚStringScalarÚLargeStringScalarÚStringViewScalarÚFixedSizeBinaryScalarÚDictionaryScalarÚ	MapScalarÚStructScalarÚUnionScalarÚRunEndEncodedScalarÚBool8ScalarÚExtensionScalarÚFixedShapeTensorScalarÚOpaqueScalarÚ
UuidScalar)ÚDeviceAllocationTypeÚDeviceÚMemoryManagerÚdefault_cpu_memory_manager)ÚBufferÚResizableBufferÚforeign_bufferÚ	py_bufferrD   ÚcompressÚ
decompressÚallocate_buffer)Ú
MemoryPoolÚLoggingMemoryPoolÚProxyMemoryPoolÚtotal_allocated_bytesÚset_memory_poolr?   Úsystem_memory_poolÚjemalloc_memory_poolÚmimalloc_memory_poolÚlogging_memory_poolÚproxy_memory_poolÚlog_memory_allocationsÚjemalloc_set_decay_msrC   )Ú
NativeFileÚ
PythonFileÚBufferedInputStreamÚBufferedOutputStreamÚCacheOptionsÚCompressedInputStreamÚCompressedOutputStreamÚTransformInputStreamÚtranscoding_input_streamÚFixedSizeBufferWriterÚBufferReaderÚBufferOutputStreamÚOSFileÚMemoryMappedFileÚ
memory_mapÚcreate_memory_mapÚMockOutputStreamÚinput_streamÚoutput_streamÚhave_libhdfs)ÚChunkedArrayÚRecordBatchÚTableÚtableÚconcat_arraysÚconcat_tablesÚTableGroupByÚRecordBatchReader)ÚArrowCancelledÚArrowCapacityErrorÚArrowExceptionÚArrowKeyErrorÚArrowIndexErrorÚArrowInvalidÚArrowIOErrorÚArrowMemoryErrorÚArrowNotImplementedErrorÚArrowTypeErrorÚArrowSerializationError)Úserialize_pandasÚdeserialize_pandas)Ú_deprecate_apiÚ_deprecate_class)ÚMessageÚMessageReaderÚMetadataVersionÚRecordBatchFileReaderÚRecordBatchFileWriterÚRecordBatchStreamReaderÚRecordBatchStreamWriterc                   C   s   t j t j t¡d¡S )zr
    Return absolute path to directory containing Arrow C++ include
    headers. Similar to numpy.get_include
    Úinclude)Ú_osÚpathrB   ÚdirnameÚ__file__r   r   r   r	   Úget_include3  s   rY  c                   C   s   t j dd¡S )NÚ
PKG_CONFIGú
pkg-config)rU  ÚenvironÚgetr   r   r   r	   Ú_get_pkg_config_executable;  s   r^  c                 C   s6   dd l }z| tƒ d| g¡dkW S  ty   Y dS w )Nr   z--existsF)Ú
subprocessÚcallr^  ÚFileNotFoundError)Úpkgnamer_  r   r   r	   Ú_has_pkg_config?  s   ÿÿÿrc  c                 C   s`   dd l }tƒ | g| }|j||j|jd�}| ¡ \}}|jdkr)td| d¡ ƒ‚| ¡  d¡S )Nr   )ÚstdoutÚstderrzpkg-config failed: rb   )	r_  r^  ÚPopenÚPIPEÚcommunicateÚ
returncodeÚRuntimeErrorÚdecodeÚrstrip)rb  Zcli_argsr_  ÚcmdÚprocÚoutÚerrr   r   r	   Ú_read_pkg_config_variableH  s   
ÿ
rq  c                   C   s   ddgS )zz
    Return list of library names to include in the `libraries` argument for C
    or Cython extensions using pyarrow
    Úarrow_pythonÚarrowr   r   r   r   r	   Úget_librariesS  s   rt  c               	   C   s´   ddl } tjdkrdS tj t¡}tjdkr%|   tj |d¡¡}dd„ }n|   tj |d¡¡}d	d„ }|D ]"}||ƒ}tj |¡rBq5zt 	||¡ W q5 t
yW   td
ƒ Y q5w dS )a#  
    With Linux and macOS wheels, the bundled shared libraries have an embedded
    ABI version like libarrow.so.17 or libarrow.17.dylib and so linking to them
    with -larrow won't work unless we create symlinks at locations like
    site-packages/pyarrow/libarrow.so. This unfortunate workaround addresses
    prior problems we had with shipping two copies of the shared libraries to
    permit third party projects like turbodbc to build their C++ extensions
    against the pyarrow wheels.

    This function must only be invoked once and only when the shared libraries
    are bundled with the Python package, which should only apply to wheel-based
    installs. It requires write access to the site-packages/pyarrow directory
    and so depending on your system may need to be run with root.
    r   NÚwin32Úlinuxz*.so.*c                 S   s   |   dd¡d S )NÚ.r   r   )Úrsplit©Z	hard_pathr   r   r	   Úget_symlink_pathr  s   z1create_library_symlinks.<locals>.get_symlink_pathz	*.*.dylibc                 S   s   d  |  dd¡d df¡S )Nrw  é   r   Zdylib)rB   rx  ry  r   r   r	   rz  w  r!   zyTried creating symlink {}. If you need to link to bundled shared libraries, run pyarrow.create_library_symlinks() as root)ÚglobÚ_sysÚplatformrU  rV  rW  rX  rB   ÚexistsÚsymlinkÚPermissionErrorr   )r|  Úpackage_cwdZbundled_libsrz  Zlib_hard_pathZsymlink_pathr   r   r	   Úcreate_library_symlinks[  s&   


ÿúrƒ  c                     s  t j t¡} | g‰ ‡ fdd„}t j d¡pd}dD ]"}t|ƒr;t|dgƒ}|r;| d¡s3t	d 
|¡ƒ‚||d	d
… ƒ qtjdkr_t j tj¡}t j |dd¡}t j t j |d¡¡r_||ƒ t j d¡rs|t j t jd d¡ƒ ˆ S |t j t j t¡¡ƒ ˆ S )z€
    Return lists of directories likely to contain Arrow C++ libraries for
    linking C or Cython extensions using pyarrow
    c                    s   | ˆ vrˆ   | ¡ d S d S )N)Úappend)Úlibrary_dir©Zlibrary_dirsr   r	   Úappend_library_dirŽ  s   ÿz,get_library_dirs.<locals>.append_library_dirrZ  r[  )rs  rr  z--libs-only-Lz-Lz7pkg-config --libs-only-L returned unexpected value {!r}r{  Nru  ÚLibraryÚlibz	arrow.libZ
ARROW_HOME)rU  rV  rW  rX  r\  r]  rc  rq  Ú
startswithÚ
ValueErrorÚformatr}  r~  Ú
executablerB   r  Úabspath)r‚  r‡  Zpkg_config_executablerb  r…  Zpython_base_installr   r†  r	   Úget_library_dirs†  s6   ÿ
þ€
þr�  (E  Ú__doc__ÚgcZ_gcÚ	importlibr%   ÚosrU  r~  r<   Úsysr}  ÚwarningsÚ	_warningsZ_generated_versionr   Ú__version__r'   Zsetuptools_scmr
   Úget_versionÚ	isenabledZ_gc_enabledÚdisableZpyarrow.libr‰  Ú_libÚenabler   r   r   r   r   r   r   r   r   r   r   r   r   r   r$   r)   r.   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   r€   r�   r‚   rƒ   r„   r…   r†   r‡   rˆ   r‰   rŠ   r‹   rŒ   r�   rŽ   r�   r�   r‘   r’   r“   r”   r•   r–   r—   r˜   r™   rš   r›   rœ   r�   rž   rŸ   r    r¡   r¢   r£   r¤   r¥   r¦   r§   r¨   r©   rª   r«   r¬   r­   r®   r¯   r°   r±   r²   r³   r´   rµ   r¶   r·   r¸   r¹   rº   r»   r¼   r½   r¾   r¿   rÀ   rÁ   rÂ   rÃ   rÄ   rÅ   rÆ   rÇ   rÈ   rÉ   rÊ   rË   rÌ   rÍ   rÎ   rÏ   rÐ   rÑ   rÒ   rÓ   rÔ   rÕ   rÖ   r×   rØ   rÙ   rÚ   rÛ   rÜ   rÝ   ÚNULLrÞ   rß   rà   rá   râ   rã   rä   rå   ræ   rç   rè   ré   rê   rë   rì   rí   rî   rï   rð   rñ   rò   ró   rô   rõ   rö   r÷   rø   rù   rú   rû   rü   rý   rþ   rÿ   r   r  r  r  r  r  r  r  r  r	  r
  r  r  r  r  r  r  r  r  rD   r  r  r  r  r  r  r  r  r?   r  r  r  r  r  r   r!  rC   r"  r#  r$  r%  r&  r'  r(  r)  r*  r+  r,  r-  r.  r/  r0  r1  r2  r3  r4  r5  r6  r7  r8  r9  r:  r;  r<  r=  r>  r?  r@  rA  rB  rC  rD  rE  rF  rG  rH  Zpyarrow.ipcrI  rJ  ZipcZpyarrow.typesÚtypesZpyarrow.utilrK  rL  rM  rN  rO  rP  rQ  rR  rS  rY  r^  rc  rq  rt  rƒ  r�  r   r   r   r	   Ú<module>   sj   	
ÿÿ€ï@	þ*þ þ 
 Q(\¨	H`B
	


	

+