
    bMh                     "   d dl Z d dlZd dlZd dlZd dlZd dlmZmZmZm	Z	 d dl
mc mZ d dlmc mZ d dlmZ ej        d             Zej        d             Zej        d             Zej        d             Zej        d             Zej        d	             Zej        d
             Zej        d             Zej        d             Zej        d             Zej        d             Zej        d             Z ej        d             Z!dddddddddd ej"        d ej#        d                     ej"        d ej#        d                    gZ$ ej        e$dd                    d!             Z% ej        e$           d"             Z&dS )#    N)is_ci_environmentis_platform_armis_platform_macis_platform_windowsread_csvc                  R    d t           j                                        D             S )Nc                     i | ]\  }}||	S  r   ).0keyvalues      X/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pandas/tests/io/conftest.py
<dictcomp>z,compression_to_extension.<locals>.<dictcomp>   s    OOO:3E3OOO    )icomextension_to_compressionitemsr   r   r   compression_to_extensionr      s%    OO)F)L)L)N)NOOOOr   c                      | dddd          S )zPath to the tips datasetiodatacsvtips.csvr   datapaths    r   	tips_filer      s     8D&%444r   c                      | dddd          S )zPath to a JSONL datasetr   parserr   items.jsonlr   r   s    r   
jsonl_filer!      s     8D(FM:::r   c                 <    t           | dddd          d          S )z#DataFrame with the salaries datasetr   r   r   zsalaries.csv	)sepr   r   s    r   salaries_tabler%   %   s'     HHT8V^DD$OOOOr   c                      | dddd          S )Nr   r   featherzfeather-0_3_1.featherr   r   s    r   feather_filer(   +   s    8D&)-DEEEr   c                      | dddd          S )Nr   r   xml	books.xmlr   r   s    r   xml_filer,   0   s    8D&%555r   c              #     K   t          j        d           t          j        d           |                    dd           |                    dd           t                      rFt	                      st                      st                      rt          j        d           dS dV  dS t          j        d	          }t          j        d
           t          j        d           | dk    rdn|                     d          } d|  }d| d}t          j
        t          j        d|           t          j        t          j                  5 }d}|dk    rN	 |                    |          }|j        rn0n# t           $ r Y nw xY w|dz  }t#          j        d           |dk    N|V  |                                 ddd           dS # 1 swxY w Y   dS )z
    Fixture for mocking S3 interaction.

    Sets up moto server in separate process locally
    Return url for motoserver/moto CI service
    s3fsboto3AWS_ACCESS_KEY_ID
foobar_keyAWS_SECRET_ACCESS_KEYfoobar_secretzJS3 tests do not have a corresponding service on Windows or macOS platformszhttp://localhost:5000requestsmotoflaskmaster5gw555zhttp://127.0.0.1:/zmoto_server s3 -p )stdoutstderr   r   g?N)pytestimportorskipsetenvr   r   r   r   skiplstrip
subprocessPopenshlexsplitDEVNULLgetok	Exceptiontimesleep	terminate)	worker_idmonkeypatchr4   endpoint_portendpoint_uriproctimeoutrs           r   s3_baserV   5   sq      
    *L999.@@@ , 	* 1 1 	*5H5J5J 	*
 K-     *)))))&z22F###G$$$
 %00CCi6F6Ft6L6L	)i));=;;; K<]<<==%%
 
 
 	 GA++ \22At     D3
3 A++ NN%	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s6   	GE75G7
FGF:GGGc                     dd| iiS )Nclient_kwargsendpoint_urlr   )rV   s    r   s3sorZ   s   s    ng677r   c                 <    dd l }|                    d|           }|S )Nr   s3)rY   )r/   resource)rV   r/   r\   s      r   s3_resourcer^   x   s%    LLL	7	3	3BIr   c              #      K   |                      dt          j                               }|                                 |V  |j                                         |                                 d S )Nzpandas-test-Bucketuuiduuid4createobjectsdeleter^   buckets     r   s3_public_bucketri      sc       =tz|| = =>>F
MMOOO
LLL
N
MMOOOOOr   c                     d|fd|fd|dz   fd|dz   fd|fd|fd	|fg}|D ]D\  }}t          |d
          5 }|                     ||           ddd           n# 1 swxY w Y   E| S zw
    The following datasets
    are loaded.

    - tips.csv
    - tips.csv.gz
    - tips.csv.bz2
    - items.jsonl
    z
tips#1.csvr   ztips.csv.gz.gzztips.csv.bz2.bz2r    zsimple_dataset.featherr+   rb)KeyBodyNopen
put_object)	ri   r   r!   r(   r,   test_s3_filess3_key	file_namefs	            r   s3_public_bucket_with_datarx      s     
y!	Y		E)*	V+,	
#	!<0	hM + < <	)T"" 	<a''F';;;	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	<   AA	 A	c              #      K   |                      dt          j                               }|                    d           |V  |j                                         |                                 d S )Nzcant_get_it-private)ACLr`   rg   s     r   s3_private_bucketr}      sj       =tz|| = =>>F
MMiM   
LLL
N
MMOOOOOr   c                     d|fd|fd|dz   fd|dz   fd|fd|fd	|fg}|D ]D\  }}t          |d
          5 }|                     ||           ddd           n# 1 swxY w Y   E| S rk   rq   )	r}   r   r!   r(   r,   rt   ru   rv   rw   s	            r   s3_private_bucket_with_datar      s     
y!	Y		E)*	V+,	
#	!<0	hM + = =	)T"" 	=a((V!(<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	=ry   )z.no_compressN) N)rl   gzip)z.GZr   )rm   bz2)z.BZ2r   )z.zipzip)z.ZIPr   )z.xzxz)z.XZr   )z.zstzstd	zstandard)marks)z.ZSTr      )paramsc                     | j         S )Nparamrequests    r   compression_formatr      s
    =r   c                     | j         d         S )Nr   r   r   s    r   compression_extr      s    =r   )'rF   rD   rL   rb   r?   pandas.compatr   r   r   r   pandas.util._test_decoratorsutil_test_decoratorstdpandas.io.commonr   commonr   pandas.io.parsersr   fixturer   r   r!   r%   r(   r,   rV   rZ   r^   ri   rx   r}   r   r   
skip_if_no_compression_formats_paramsr   r   r   r   r   <module>r      s                      * ) ) ) ) ) ) ) )          & & & & & & P P P 5 5 5
 ; ; ;
 P P P
 F F F 6 6 6 : : :z 8 8 8         6      8 FL!{)C)CDDDFL!{)C)CDDD   21226777  87 2333  43  r   