o
    $if!                     @   s  d dl Z d dlZd dlmZ d dlmZ d dlZg dZi dddddedd	ed	d
ddddddddddddddeddddddddedddddddddddeddeddZ	z
d dl
Z
de	d
< W n	 ey   Y nw z
d dlZde	d< W n	 ey   Y nw z
d dlZde	d< W n	 ey   Y nw z
d dlZde	d< W n	 ey   Y nw z
d dlZde	d< W n	 ey   Y nw z
d dlZde	d< W n	 ey   Y nw z
d dlZde	d< W n ey   de	d< Y nw z
d dlZde	d< W n
 ey   Y nw z
d dlZde	d< W n
 ey+   Y nw z
d dlZde	d< W n
 ey@   Y nw zd d lmZ de	d< W n
 eyW   Y nw zd d!lmZ de	d< W n
 eyn   Y nw zd d"lmZ de	d#< W n
 ey   Y nw zd d$lmZ de	d< W n
 ey   Y nw z
d dlZde	d%< W n
 ey   Y nw d&d' Ze jdd(d)d* Ze jdd(d+d, Ze jd-d.d/d0 Ze jd-d.d1d2 Z e jd-d.d3d4 Z!dS )5    N)Codec)fs)aceroazurebrotlibz2cythondataset
hypothesisfastparquetgandivagcsgdbgziphdfslarge_memorylz4memory_leaknopandasorcpandasparquetparquet_encryptions3snappy	substraitflightslowrequires_testing_datazstdr   Fr   r   r   r   r	   r   r   r   r   r   Tr   r   r
   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )AzureFileSystem)GcsFileSystemS3FileSystemr   )HadoopFileSystemr   c                 C   s   |j jrcdt| v rdS g d}|D ]}d|t| v r$t| s$ dS qdt| v r1td s1dS dt| v rIzdd l}W d	S  tyH   Y dS w d
t| v rcz	ddlm} W d	S  tyb   Y dS w t	|j dd	rzdt| v rrdS dt| v rzdS d	S )Nz/pyarrow/tests/T)r	   r   r   r   r   z
pyarrow/{}zpyarrow/parquet/encryptionr   zpyarrow/cudar   Fz
pyarrow/fsr"   doctest_cythonz/pyarrow/_parquet_encryption)
optiondoctestmodulesstrformatdefaultspyarrow.cudaImportError
pyarrow.fsr#   getattr)pathconfigdoctest_groupsgrouppyarrowr#    r4   I/var/www/html/corbot_env/lib/python3.10/site-packages/pyarrow/conftest.pypytest_ignore_collect   s@   	r6   )autousec                 c   sl    | j jj}t| j jdd}|s|r1| d}|  d V  W d    d S 1 s*w   Y  d S d V  d S )Nr%   Ftmpdir)r0   r&   r'   r.   getfixturevalueas_cwd)request	doctest_m	doctest_cr8   r4   r4   r5   _docdir   s   


"
r>   c                 c   s    |j jj}t|j jdd}|s|rJt| d< t }|d }|t|}|d W d    n1 s5w   Y  || d< t|| d< t|| d< d V  d S )	Nr%   Fr   zpyarrow-fs-example.dats   datalocal
local_pathr/   )	r0   r&   r'   r.   r   LocalFileSystemopen_output_streamr(   write)doctest_namespacer;   tmp_pathr<   r=   r?   r/   streamr4   r4   r5   add_fs   s   

rG   session)scopec                     sL   ddl m   fdd} d}ddd} | ||d	t it  | |fS )
z+
    Register a unary scalar function.
    r   computec                    s    j d|dg| jdS )Nadd   )memory_pool)call_functionrN   ctxxpcr4   r5   unary_function  s   z*unary_func_fixture.<locals>.unary_functionzy=x+1zadd functionztest add functionsummarydescriptionarray)r3   rK   register_scalar_functionpaint64)rU   	func_name	unary_docr4   rS   r5   unary_func_fixture  s   
r_   c                  C   sH   ddl m}  dd }d}ddd}| |||d	t it  ||fS )
z4
    Register a unary aggregate function (mean)
    r   rJ   c                 S   s   t t|S )N)r[   scalarnpnanmeanrP   r4   r4   r5   func+  s   z$unary_agg_func_fixture.<locals>.funcmean_udfzy=avg(x)zfind mean of xrV   rR   )r3   rK   register_aggregate_functionr[   float64rT   rc   r]   func_docr4   r4   r5   unary_agg_func_fixture$  s   ri   c                  C   sN   ddl m}  dd }d}ddd}| |||t t dt  ||fS )	z-
    Register a unary aggregate function
    r   rJ   c                 W   s&   d}|D ]	}|t |7 }qt|S )Ng        )ra   rb   r[   r`   )rQ   argssumargr4   r4   r5   rc   D  s   
z&varargs_agg_func_fixture.<locals>.funcsum_meanzVarargs aggregaterV   )rR   y)r3   rK   re   r[   r\   rf   rg   r4   r4   r5   varargs_agg_func_fixture=  s   	ro   )"pytestr3   r[   r   r   numpyra   groupsis_availabler*   r   r,   r   pyarrow.gandivapyarrow.aceropyarrow.datasetpyarrow.orcr   pyarrow.parquetpyarrow.parquet.encryptionpyarrow.flightr-   r    r!   r#   r$   pyarrow.substraitr6   fixturer>   rG   r_   ri   ro   r4   r4   r4   r5   <module>   s4  

	



0







