U
    -eF!                     @   s  d dl Z d dlZd dlmZ d dlmZ d dlZdddddd	d
ddddddddddddddddddddgZdededddddddd edddde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k
r   Y nX zd dlZd e	d
< W n ek
r   Y nX zd dlZd e	d< W n ek
rJ   Y nX zd dlZd e	d< W n ek
rv   Y nX zd dlZd e	d< W n ek
r   Y nX zd dlZd e	d< W n ek
r   Y nX zd dlZd e	d< W n ek
r   d e	d< Y nX zd dlZd e	d< W n ek
r.   Y nX zd dlZd e	d< W n ek
rZ   Y nX zd dlZd e	d< W n ek
r   Y nX zd d"lmZ d e	d< W n ek
r   Y nX zd d#lmZ d e	d< W n ek
r   Y nX zd d$lmZ d e	d< W n ek
r   Y nX zd dlZd e	d< W n ek
rB   Y nX 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-d0d1 Ze jd,d-d2d3 Z dS )4    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zstdFT)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   )GcsFileSystemS3FileSystem)HadoopFileSystemc                 C   s  |j jrdt| krdS dddddg}|D ]$}d|t| kr*t| s* dS q*d	t| krhtd
 shdS dt| krzdd l}W dS  tk
r   Y dS X dt| krzddlm} W dS  tk
r   Y dS X t	|j ddrdt| k rdS dt| krdS dS )Nz/pyarrow/tests/Tr   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   Q/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/pyarrow/conftest.pypytest_ignore_collect   sD    	r2   )Zautousec              	   c   sR   | j jj}t| j jdd}|s"|rH| d}|  d V  W 5 Q R X n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"|r~t| d< t }|d }|t|}|d W 5 Q R X || 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








