
    g
                         d dl Z d dlZd dlZd dlZd dlmZ  ej                  d      d        Z ej                  d      d        Zej                  d        Z	ej                  d        Z
ej                  d	        Zy)
    N)guidmodule)scopec                     | dz  S )Nparquet )base_datadirs    S/var/www/openai/venv/lib/python3.12/site-packages/pyarrow/tests/parquet/conftest.pydatadirr      s    )##    c                      t         j                  dk(  rt        j                  d       t        j
                  j                  d      } | st        d      t        j                  |       S )N
emscriptenz$needs PARQUET_TEST_DATA files accessPARQUET_TEST_DATAzRPlease point the PARQUET_TEST_DATA environment variable to the test data directory)
sysplatformpytestskiposenvirongetRuntimeErrorpathlibPath)results    r
   parquet_test_datadirr       sU    
|||#:;ZZ^^/0F A B 	B<<r   c           	         t        j                  d      }t        j                  d      }d}| d   \  }}}}|j                  ddj                  ||      |||j                  j	                  d      d	
      }	 |j                  |       |j                          |S # t        $ r Y w xY w# |j                          w xY w)Nboto3botocorez	test-s3fs
connections3http://{}:{}s3v4)signature_versionz	us-east-1)endpoint_urlaws_access_key_idaws_secret_access_keyconfigregion_name)Bucket)r   importorskipclientformatConfigcreate_bucket	Exceptionclose)		s3_serverr   r   s3_bucket_namehostport
access_key
secret_key	s3_clients	            r
   	s3_bucketr8   +   s    (E"":.H N)2<)@&D$
J#**46$(%%%?  I~6 	   	s$   9B 	B)&B, (B))B, ,B>c           	   #   >  K   t        j                  d      }| d   \  }}}}|j                  ||ddj                  ||      i      }dj                  |t	                     }|j                  |       ||f 	 |j                  |d       y # t        $ r Y y w xY ww)	Ns3fsr   r$   r!   )keysecretclient_kwargsz{}/{}T)	recursive)r   r*   S3FileSystemr,   r   mkdirrmFileNotFoundError)	r1   r8   r:   r3   r4   r5   r6   fs	test_paths	            r
   s3_example_s3fsrE   E   s     v&D)2<)@&D$
J			N11$=
 
 
B y$&1IHHY
i-
i4( s*   A7B:B B	BBBBc              #      K   ddl m} | d   \  }}}}dj                  ||||      }|j                  |      \  }}|j	                  d       |||f y w)Nr   )
FileSystemr   z_s3://{}:{}@mybucket/data.parquet?scheme=http&endpoint_override={}:{}&allow_bucket_creation=Truemybucket)
pyarrow.fsrG   r,   from_uri
create_dir)	r1   rG   r3   r4   r5   r6   urirC   paths	            r
   s3_example_fsrN   \   sd     %)2<)@&D$
J	&	
Jd	3 
 ""3'HBMM*
c4-s   AA)r   r   r   r   pyarrow.utilr   fixturer   r   r8   rE   rN   r   r   r
   <module>rQ      s   $ 
  
   h$  $ h      2  ,  r   