
    PiU                     .   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 ej        d
          d             ZdS )    N)guidmodule)scopec                     | dz  S )Nparquet )base_datadirs    r/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/pyarrow/tests/parquet/conftest.pydatadirr      s    )##    c                      t           j        dk    rt          j        d           t          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       sh    
||##:;;;Z^^/00F B A B B 	B<r   c           	         t          j        d          }t          j        d          }d}| d         \  }}}}|                    dd| d| |||j                            d	          d
          }	 |                    |           n# t
          $ r Y nw xY w|                                 n# |                                 w xY w|S )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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,t,,d,,$(%%%??   I~6666    		s*   3B
 	B/ 

BB/ BB/ /Cc           	   #   :  K   t          j        d          }| d         \  }}}}|                    ||dd| d| i          }| dt                       }|                    |           ||fV  	 |                    |d	           d S # t          $ r Y d S w xY w)
Ns3fsr   r%   r!   r"   )keysecretclient_kwargs/T)	recursive)r   r+   S3FileSystemr   mkdirrmFileNotFoundError)	r1   r8   r:   r3   r4   r5   r6   fs	test_paths	            r
   s3_example_s3fsrF   E   s      v&&D)2<)@&D$
J			3d33T33
 
 
 
B ''tvv''IHHY
i-
i4(((((   s   3B 
BBc           	   #      K   ddl m} | d         \  }}}}d| d| d| d| d	}|                    |          \  }}|                    d           |||fV  d S )	Nr   )
FileSystemr   zs3://r"   z5@mybucket/data.parquet?scheme=http&endpoint_override=z&allow_bucket_creation=Truemybucket)
pyarrow.fsrH   from_uri
create_dir)	r1   rH   r3   r4   r5   r6   urirD   paths	            r
   s3_example_fsrO   \   s      %%%%%%)2<)@&D$
J	G
 	G 	GZ 	G 	G"	G 	G%)	G 	G 	G  ""3''HBMM*
c4-r   classc                 ,    |                      d          S )Nzpyarrow-parquet)mktemp)tmp_path_factorys    r
   reusable_tempdirrT   l   s    ""#4555r   )r   r   r   r   pyarrow.utilr   fixturer   r   r8   rF   rO   rT   r   r   r
   <module>rW      s  $ 
			  



        h$ $  $ h         2   ,    g6 6 6 6 6r   