o
    ZhF!                     @   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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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yU   Y nw zd d lmZ de	d!< W n
 eyl   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-d. Ze jd+d,d/d0 Ze jd+d,d1d2 Z dS )3    N)Codec)fs)acero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   Tr   r   r	   r   r   r   r   r   r   )
r   r   r   r   r   r   r   r   r   r   r   r   r   r   )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defaultsZpyarrow.cudaImportError
pyarrow.fsr!   getattr)pathconfigZdoctest_groupsgrouppyarrowr!    r0   G/var/www/html/lang_env/lib/python3.10/site-packages/pyarrow/conftest.pypytest_ignore_collect   s@   	r2   )Z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)r-   r$   r%   r+   ZgetfixturevalueZas_cwd)request	doctest_m	doctest_cr3   r0   r0   r1   _docdir   s   


"
r7   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localZ
local_pathr,   )	r-   r$   r%   r+   r   ZLocalFileSystemZopen_output_streamr&   write)Zdoctest_namespacer4   Ztmp_pathr5   r6   r8   r,   streamr0   r0   r1   add_fs   s   

r;   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)Zcall_functionrB   ctxxpcr0   r1   unary_function  s   z*unary_func_fixture.<locals>.unary_functionzy=x+1zadd functionztest add functionsummarydescriptionarray)r/   r?   Zregister_scalar_functionpaint64)rH   	func_nameZ	unary_docr0   rF   r1   unary_func_fixture  s   
rP   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   r>   c                 S   s   t t|S )N)rM   scalarnpnanmeanrC   r0   r0   r1   func$  s   z$unary_agg_func_fixture.<locals>.funcZmean_udfzy=avg(x)zfind mean of xrI   rE   )r/   r?   register_aggregate_functionrM   float64rG   rT   rO   Zfunc_docr0   r0   r1   unary_agg_func_fixture  s   rX   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   r>   c                 W   s&   d}|D ]	}|t |7 }qt|S )Ng        )rR   rS   rM   rQ   )rD   argssumargr0   r0   r1   rT   =  s   
z&varargs_agg_func_fixture.<locals>.funcZsum_meanzVarargs aggregaterI   )rE   y)r/   r?   rU   rM   rN   rV   rW   r0   r0   r1   varargs_agg_func_fixture6  s   	r]   )!Zpytestr/   rM   r   r   numpyrR   groupsZis_availabler(   r   r)   r
   Zpyarrow.gandivaZpyarrow.aceroZpyarrow.datasetZpyarrow.orcr   Zpyarrow.parquetZpyarrow.parquet.encryptionZpyarrow.flightr*   r   r!   r"   Zpyarrow.substraitr2   Zfixturer7   r;   rP   rX   r]   r0   r0   r0   r1   <module>   s&  

	



0







