+
    nDj
"                    Z   ^ RI H t HtHt ^ RIt^ RIt^ RIt^ RIHt ^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIHt ^ RIHtHtHtHt ^ RIHtHtHtHtHtHtHtHtHtH t H!t! ^ RI"H#t# ]PH                  PK                  ]PH                  PM                  ]'4      4      t( ! R R	]4      t)]PT                  R
 4       t+]PT                  R 4       t,]PT                  R 4       t-]PT                  R 4       t.]PT                  R 4       t/]PT                  R 4       t0]PT                  R 4       t1]PT                  R 4       t2]PT                  R 4       t3Rt4]PT                  R 4       t5]PT                  R 4       t6]PT                  R 4       t7]PT                  R 4       t8]PT                  R 4       t9]PT                  ! ]Pt                  ! RRR7      ]Pt                  ! RRR7      ]Pt                  ! RRR7      ]Pt                  ! R R!]Pv                  Px                  R"7      ]Pt                  ! R#R$]Pv                  Pz                  R"7      ]Pt                  ! R%R&]Pv                  P|                  R"7      ]Pt                  ! R'R(]Pv                  Pl                  R"7      ]Pt                  ! R)R*R7      ]Pt                  ! R+R,R7      ]Pt                  ! R-R.R7      ]Pt                  ! R/R0R7      ]Pt                  ! R1R2R7      ]Pt                  ! R3R4]Pv                  Px                  R"7      .R57      R6 4       t?]PT                  R7 4       t@]PT                  R8 4       tA]PT                  R9 4       tB]PT                  R: 4       tCR; tDR< tER= tFR> tGR? tH]Pv                  Px                  R@ 4       tIRA tJRB tKRC tLRD tMRE tN ! RF RG4      tO]PT                  ! RHRI.R57      RJ 4       tPRK tQRL tRRM tSRN tTRO tURP tVRQ tWRR tXRS tYRT tZRU t[RV t\RW t]RX t^RY t_RZ t`R[ taR\ tb]Pv                  P                  ]Pv                  P                  RRR]b3R^@]b3R]R]P                  3R]R^]P                  3.4      R_ 4       4       teR` tfRa tg]Pv                  P                  ]Pv                  P                  RRR]b3R^@]b3R]R]P                  3R]R^]P                  3.4      Rb 4       4       ti]Pv                  P                  ]Pv                  P                  RRR]b]b3R^@]b]b3R]R]P                  ]P                  3R]R^]P                  ]P                  3.4      Rc 4       4       tjRd tkRe tlRf tmRg tnRh to]Pv                  Pz                  Ri 4       tp]Pv                  Px                  Rj 4       tq]Pv                  Px                  Rk 4       tr]Pv                  Px                  Rl 4       ts]Pv                  P|                  Rm 4       tt]Pv                  Pl                  Rn 4       tu]Pv                  P                  RRo]Rp3Rq]Rr3Rs]Rr3Rt]Rr3Ru]Rv3Rw]Rx3Ry]Rx3Rz]R{3R|]R{3R}]R~3Rx]Rx3R{]R{3R]R3.4      R 4       tvR tw]Pv                  P                  RRpRxRrR{]'.4      R 4       tx]Pv                  Px                  R 4       ty]Pv                  Pz                  R 4       tzR t{R t|R t}R t~R tR tR tR tR tR tR t]Pv                  Px                  R 4       t]Pv                  Px                  R 4       t]Pv                  Px                  R 4       t]Pv                  Px                  R 4       tR t]Pv                  Px                  R 4       t]Pv                  Px                  R 4       t]Pv                  EP                  ]Pv                  EP                  ]Pv                  Px                  R 4       4       4       t]Pv                  Px                  ]Pv                  EP!                  RR7      ]Pv                  EP#                  ]! 4       RR7      R 4       4       4       tR tR tR tR# )    )datetimetimezone	timedeltaN)urlopen)assert_file_not_found)_filesystem_uriProxyHandler_configure_s3_limited_userrunning_on_musllinux)FileTypeFileInfoFileSelector
FileSystemLocalFileSystemSubTreeFileSystem_MockFileSystemFileSystemHandlerPyFileSystemFSSpecHandler
copy_files)find_free_portc                      a  ] tR t^.t o RR ltR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tRtV tR# )DummyHandlerc                    Wn         R # N_value)selfvalues   &&O/data/cameron/venvs/s3viz/lib/python3.14/site-packages/pyarrow/tests/test_fs.py__init__DummyHandler.__init__/   s        c                l    \        V\        4      '       d   V P                  VP                  8H  # \        # r   
isinstancer   r   NotImplementedr   others   &&r    __eq__DummyHandler.__eq__2   )    e.//;;%,,..r#   c                l    \        V\        4      '       d   V P                  VP                  8g  # \        # r   r%   r(   s   &&r    __ne__DummyHandler.__ne__7   r,   r#   c                    R # )dummy r   s   &r    get_type_nameDummyHandler.get_type_name<   s    r#   c                    V# r   r2   r   paths   &&r    normalize_pathDummyHandler.normalize_path?   s    r#   c                   . pV F  pR V9   d,   VP                  \        V\        P                  4      4       K5  RV9   d,   VP                  \        V\        P                  4      4       Kg  RV9   d,   VP                  \        V\        P
                  4      4       K  RV9   d   VP                  \        4       4       K  \        h	  V# )filedirnotfoundbadtype)appendr   r   File	DirectoryNotFoundobjectIOError)r   pathsinfor8   s   &&  r    get_file_infoDummyHandler.get_file_infoB   s    D~HT8==9:$HT8+=+=>?t#HT8+<+<=>d"FH%  r#   c                R   VP                   R 8w  d*   VP                  '       d   . # \        VP                   4      h\        R\        P
                  ^{R7      \        R\        P                  4      .pVP                  '       d%   V\        R\        P
                  RR7      .,          pV# )somedirsomedir/file1)sizesomedir/subdir1somedir/subdir1/file2i  )base_dirallow_not_foundFileNotFoundErrorr   r   rA   rB   	recursive)r   selectorinfoss   && r    get_file_info_selector#DummyHandler.get_file_info_selectorR   s    	)'''	'(9(9::_hmm#>&(:(:;
 0(--cJ E r#   c                R    VR 8X  d   VRJ g   Q hR# VR8X  d   VRJ g   Q hR# \         h)rS   Tnon-recursiveFN)rE   )r   r8   rS   s   &&&r    
create_dirDummyHandler.create_dirb   s3    ;$$$_$%%%Mr#   c                    VR 8X  g   Q hR# )
delete_dirNr2   r7   s   &&r    r]   DummyHandler.delete_dirj   s    |###r#   c                R    VP                  R 4      '       g   \        hVR8X  g   Q hR# )/delete_dir_contentsN)strip
ValueError)r   r8   missing_dir_oks   &&&r    ra    DummyHandler.delete_dir_contentsm   s$    zz#,,,,r#   c                    R # r   r2   r3   s   &r    delete_root_dir_contents%DummyHandler.delete_root_dir_contentsr   s    r#   c                    VR 8X  g   Q hR# )delete_fileNr2   r7   s   &&r    rj   DummyHandler.delete_fileu   s    }$$$r#   c                *    VR 8X  g   Q hVR8X  g   Q hR# )	move_frommove_toNr2   r   srcdests   &&&r    moveDummyHandler.movex   s    k!!!y   r#   c                *    VR 8X  g   Q hVR8X  g   Q hR# )copy_file_fromcopy_file_toNr2   ro   s   &&&r    	copy_fileDummyHandler.copy_file|   s    &&&&~%%%r#   c                z    R V9   d   \        V4      hV R2P                  R4      p\        P                  ! V4      # )r>   z:input_streamutf8rR   encodepaBufferReaderr   r8   datas   && r    open_input_streamDummyHandler.open_input_stream   s;    #D))}%,,V4t$$r#   c                z    R V9   d   \        V4      hV R2P                  R4      p\        P                  ! V4      # )r>   z:input_filerz   r{   r   s   && r    open_input_fileDummyHandler.open_input_file   s;    #D)){#**62t$$r#   c                P    R V9   d   \        V4      h\        P                  ! 4       # r>   rR   r}   BufferOutputStreamr   r8   metadatas   &&&r    open_output_streamDummyHandler.open_output_stream   $    #D))$$&&r#   c                P    R V9   d   \        V4      h\        P                  ! 4       # r   r   r   s   &&&r    open_append_streamDummyHandler.open_append_stream   r   r#   r   N)*   )__name__
__module____qualname____firstlineno__r!   r*   r.   r4   r9   rH   rV   rZ   r]   ra   rg   rj   rr   rw   r   r   r   r   __static_attributes____classdictcell____classdict__s   @r    r   r   .   sd     

  $-
%!&%%'
' 'r#   r   c                 :   a \        \        4       V3R  lRRR7      # )c                 2   < SV ,          P                  4       # r   as_posixptempdirs   &r    <lambda>localfs.<locals>.<lambda>       'A+//1r#   Tfspathfnallow_move_dirallow_append_to_filedictr   requestr   s   &fr    localfsr      s    1!	 r#   c                 ^   a \        \        \        \        4       4      4      V3R  lRRR7      # )c                 2   < SV ,          P                  4       # r   r   r   s   &r    r   py_localfs.<locals>.<lambda>   r   r#   Tr   )r   r   r	   r   r   s   &fr    
py_localfsr      s)    _%6781!	 r#   c                 2    \        \        4       R  RRR7      # )c                     V # r   r2   r   s   &r    r   mockfs.<locals>.<lambda>       r#   Tr   )r   r   r   s   &r    mockfsr      s    !	 r#   c                 V    \        \        \        \        4       4      4      R  RRR7      # )c                     V # r   r2   r   s   &r    r   py_mockfs.<locals>.<lambda>   r   r#   Tr   )r   r   r	   r   r   s   &r    	py_mockfsr      s(    _%678!	 r#   c                 >   a \        \        R R7      V3R lR R R7      # )Tuse_mmapc                 2   < SV ,          P                  4       # r   r   r   s   &r    r   #localfs_with_mmap.<locals>.<lambda>   r   r#   r   r   r   s   &fr    localfs_with_mmapr      s!    D)1!	 r#   c                 V    \        \        \        V4      VR ,          4      R RRR7      # )r   c                     V # r   r2   r   s   &r    r   !subtree_localfs.<locals>.<lambda>   r   r#   Tr   )r   r   str)r   r   r   s   &&&r    subtree_localfsr      s*    S\74=9!	 r#   c           	   #     "   V P                   P                  P                  R 4       ^ RIHp VR,          w  r4RpV! V RV 2RR\        ^-R7      RR	7      p VP                  V4       \        VVP                  RRR7      x  VP                  V4       R#   \         d'   p\        P                  ! R
T RT 24        Rp?LZRp?ii ; i5i)gcsGcsFileSystem
connectionpyarrow-filesystem/:httpT)secondstest-project-id)endpoint_overridescheme	anonymousretry_time_limit
project_idzCould not create directory in : NFr   )configpyarrowrequires
pyarrow.fsr   r   rZ   OSErrorpytestskipr   __add__r]   )r   
gcs_serverr   hostportbucketr   es   &&      r    gcsfsr      s     NN##E*(L)JD"F	!F!D6*"2.$
B@
f ~~"	  MM&  @4RD1#>??@s0   ACB ).CC"C>CCCc           	   #      "   V P                   P                  P                  R 4       ^ RIHp VR,          w  r4rVRpV! VVV RV 2RRRR7      pVP                  V4       \        VVP                  RRR	7      x  VP                  V4       R
# 5i)s3S3FileSystemr   r   r   r   T)
access_key
secret_keyr   r   allow_bucket_creationallow_bucket_deletionFr   N)	r   r   r   r   r   rZ   r   r   r]   )	r   	s3_serverr   r   r   r   r   r   r   s	   &&       r    s3fsr      s     NN##D)')2<)@&D
"F	!F!D6*""
B MM&
~~"	  MM&s   BBc                 X    R p\        \        W!R,          4      VP                  RRR7      # )zpyarrow-filesystem/prefix/r   Fr   )r   r   r   )r   r   prefixs   && r    subtree_s3fsr     s-    )FV$Z0~~"	 r#   a  {
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListAllMyBuckets",
                "s3:PutObject",
                "s3:GetObject",
                "s3:ListBucket",
                "s3:PutObjectTagging",
                "s3:DeleteObject",
                "s3:GetObjectVersion"
            ],
            "Resource": [
                "arn:aws:s3:::*"
            ]

        },
        {
            "Effect": "Deny",
            "Action": [
                "s3:DeleteObject"
            ],
            "Resource": [
                "arn:aws:s3:::no-delete-bucket*"
            ]
        }
    ]
}c           	   #   (  "   V P                   P                  P                  R 4       ^ RIHp VR,          w  r4rVV RV 2pRpRp	V! VVVVVVR7      p
V
P                  V	4       \        V
V	P                  RRR7      x  V
P                  V	4       R	# 5i)
azureAzureFileSystemr   r   r   r   account_nameaccount_keyblob_storage_authoritydfs_storage_authorityblob_storage_schemedfs_storage_schemeTr   N)	r   r   r   r   r   rZ   r   r   r]   )r   azure_serverr   r   r   r   r   azurite_authorityazurite_scheme	containerr   s   &&         r    azurefsr  7  s     NN##G,*,8,F)D&$(N%I	l%00A/@-;,:
<B MM)
  !	  MM)s   BBc                     V P                   P                  P                  R 4       \        P                  ! 4       '       g   \
        P                  ! R4       ^ RIHp Vw  r4pV! W4VR7      p\        VR RRR7      # )hdfsCannot locate libhdfsHadoopFileSystem)r   userc                     V # r   r2   r   s   &r    r   hdfs.<locals>.<lambda>a  r   r#   Tr   )
r   r   r   r}   have_libhdfsr   r   r   r  r   )r   hdfs_connectionr  r   r   r	  r   s   &&     r    r  r  T  sf    NN##F+??+,+&D	$	5B!	 r#   c                    a \         P                  ! R 4      pVP                  R4      p\        \	        \        V4      4      V3R lRRR7      # )fsspecr<   c                 2   < SV ,          P                  4       # r   r   r   s   &r    r   #py_fsspec_localfs.<locals>.<lambda>m  r   r#   Tr   )r   importorskip
filesystemr   r   r   r   r   r  r   s   &f  r    py_fsspec_localfsr  g  sF      *F			6	"Bb)*1!	 r#   c                     \         P                  ! R RR7      pVP                  R8X  d   \         P                  ! R4       VP	                  R4      p\        \        \        V4      4      R RRR7      # )	r  z0.7.5)
minversionz0.8.5z,Bug in fsspec 0.8.5 for in-memory filesystemmemoryc                     V # r   r2   r   s   &r    r   $py_fsspec_memoryfs.<locals>.<lambda>|  r   r#   Tr   )r   r  __version__r   r  r   r   r   r  s   &&  r    py_fsspec_memoryfsr  s  sb      g>FW$BC			8	$Bb)*!	 r#   c           
   #   @  "   \         P                  ! R 4      pVR,          w  r4rVRpVP                  VV\        RV RV 2R7      R7      p\	        \        V4      4      pVP                  V4       \        VVP                  RRR	7      x  VP                  V4       R
# 5i)r   r   r   zhttp://r   )endpoint_url)keysecretclient_kwargsFTr   N)	r   r  r   r   r   r   rZ   r   r]   )	r   r   r   r   r   r   r   r   r   s	   &&       r    py_fsspec_s3fsr"    s     v&D)2<)@&D
"F			'$q(?@ 
 
B
 
mB'	(BMM&
~~!	  MM&s   BBr   zLocalFileSystem())idr   zLocalFileSystem(use_mmap=True)r   z$SubTreeFileSystem(LocalFileSystem())r   r   )r#  marksr   r   r  r   r  r  r   z_MockFileSystem()r   z-PyFileSystem(ProxyHandler(LocalFileSystem()))r   z-PyFileSystem(ProxyHandler(_MockFileSystem()))r  z5PyFileSystem(FSSpecHandler(fsspec.LocalFileSystem()))r  z8PyFileSystem(FSSpecHandler(fsspec.filesystem("memory")))r"  z0PyFileSystem(FSSpecHandler(s3fs.S3FileSystem())))paramsc                 8    V P                  V P                  4      # r   )getfixturevalueparamr   s   &r    filesystem_configr)    s    x ""7==11r#   c                     V R ,          # r   r2   r)  s   &r    r   r     s    T""r#   c                     V R ,          # )r   r2   r,  s   &r    r   r     s    X&&r#   c                     V R ,          # )r   r2   r,  s   &r    r   r     s    -..r#   c                     V R ,          # )r   r2   r,  s   &r    r   r     s    344r#   c                    \        V P                  \        4      '       g   Q h\        V P                  \        4      '       g   Q hV P                  ^ 8  g   Q hV P                  \
        P                  ! V P                  P                  4       R,          4      8X  g   Q hV P                  P                  pVf   Q hVP                  R4      \        ^ 4      8X  g   Q hR# )r   g    eAN)r&   mtimer   mtime_nsintr   approx	timestamptzinfo	utcoffsetr   )	file_infor6  s   & r    check_mtimer9    s    ioox0000i((#...."""!!#c)"+ + + + __##FD!Yq\111r#   c                 F    V P                   e   Q hV P                  e   Q hR # r   )r1  r2  r8  s   &r    check_mtime_absentr<    s$    ??"""%%%r#   c                 R    V P                   f   \        V 4       R # \        V 4       R # r   )r1  r<  r9  r;  s   &r    check_mtime_or_absentr>    s    9%Ir#   c                 Z    V P                   R 8X  d   \        P                  ! RR7       R# R# )py::fsspec+('s3', 's3a')zNot working with fsspec's s3fsreasonN)	type_namer   xfailr+  s   &r    skip_fsspec_s3fsrE    s!    	||11<= 2r#   c                 Z    V P                   R 8X  d   \        P                  ! VR7       R# R# )abfsrA  N)rC  r   r   )r   rB  s   &&r    
skip_azurerH  	  s    	||v6" r#   c           	         ^ RI Hp \        V \        RR4       V R,          w  r# pV! RRV RV 2RR7      pVP	                  R4       \
        P                  ! \        P                  R	R
7      ;_uu_ 4        VP	                  R4       RRR4       \
        P                  ! \        P                  RR
7      ;_uu_ 4        VP                  R4       RRR4       \
        P                  ! \        RR
7      ;_uu_ 4        VP                  RR4       RRR4       \
        P                  ! \        P                  RR
7      ;_uu_ 4        VP                  R4      ;_uu_ 4       pVP                  R4       RRR4       RRR4       VP                  R4      ;_uu_ 4       pVP                  R4       RRR4       \
        P                  ! \        RR
7      ;_uu_ 4        VP                  R4       RRR4       R#   + '       g   i     ELu; i  + '       g   i     ELA; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)r   r   test_fs_limited_user
limited123r   r   r   )r   r   r   r   zexisting-bucket/testzBucket 'new-bucket' not foundmatchz
new-bucketNzWould delete bucketzexisting-bucketzRequest ID:zexisting-bucket/test-filezexisting-bucket/test-file-copyznon-existing-bucket/test-file   testzno-delete-bucket/test-file)r   r   r
   _minio_limited_policyrZ   r   raisesr}   ArrowIOErrorr]   r   rw   r   writerj   )r   r   r   r   _r   fs   &      r    +test_s3fs_limited_permissions_create_bucketrU    s   'y*?5|E .D1	)!F!D6*	
B MM()	r.M	N	N
l# 
O 
r.C	D	D
'( 
E 
wm	4	4
02RS 
5 
rm	<	<""#BCCqGGG D 
=
 
		;	<	<	 
= 
wm	4	4
34 
5	4# 
O	N	N 
E	D	D 
5	4	4 DC 
=	<
 
=	< 
5	4	4s`   6G4>H<HIH0	1III)4H	H	H-	0I ;II	I&	)I:	c                     \         P                  ! R \        P                  4      p \	        R4      pVP
                  R8X  g   Q hVP                  R8X  g   Q hVP                  \        P                  8X  g   Q hVP                  e   Q h\        V4       \	        R\        P                  ^{RR7      pVP
                  R8X  g   Q hVP                  R8X  g   Q hVP                  \        P                  8X  g   Q hVP                  ^{8X  g   Q hVP                  R8X  g   Q h\        V4       \	        R	\        P                  V R
7      pVP
                  R	8X  g   Q hVP                  R	8X  g   Q hVP                  \        P                  8X  g   Q hVP                  e   Q hVP                   V 8X  g   Q hVP                  R8X  g   Q h\        V4       R# )R]foo/barbarNzfoo/baz.txtg  `A)typerM   r1  zbaz.txtl    t<|+. foo)rZ  r1  l    4 |+. )r   fromtimestampr   utcr   r8   	base_namerZ  r   UnknownrM   r<  rA   r2  r9  rB   r1  )dtrG   s     r    test_file_info_constructorra  2  s   			
HLL	9BID99	!!!>>U"""99(((((99tMC&(D99%%%>>Y&&&99%%%99==////E 2 2"=D99>>U"""99*****99::==////r#   c                      \         P                  ! \        4      ;_uu_ 4        \        4        R R R 4       R #   + '       g   i     R # ; ir   )r   rP  	TypeErrorr   r2   r#   r    'test_cannot_instantiate_base_filesystemrd  O  s%    	y	!	! 
"	!	!	!s	   8A		c                  \   \        4       p \        4       p\        4       pV P                  V 4      '       g   Q hV P                  V4      '       g   Q h\        P                  ! \
        4      ;_uu_ 4        V P                  R 4       RRR4       Y u;8X  d	   V8X  g   Q h Q hV ^8w  g   Q hW"8X  g   Q hV\        4       8w  g   Q h\        RV 4      \        RV 4      8X  g   Q h\        RV 4      \        RV4      8w  g   Q h\        RV 4      \        RV 4      8w  g   Q hR#   + '       g   i     L; i)stringN/basez/other)r   r   equalsr   rP  rc  r   )fs0fs1fs2s      r    test_filesystem_equalsrl  T  s    

C

C

C::c???::c???	y	!	!

8 
"!8O8::/####Wc*.?.MMMMWc*.?.MMMMWc*.?#.NNNN 
"	!s   3DD+	c                     \         P                  ! \        R R7      ;_uu_ 4        V P                  R4       RRR4       V f   Q hR#   + '       g   i     L; i)zgot NoneTyperL  N)r   rP  rc  rh  r+  s   &r    test_filesystem_equals_nonern  h  s8    	y	7	7
		$ 
8 >> 
8	7s   AA	c                  z   \        4       p \        R V 4      pVP                  R8X  g   Q hVP                  V 8X  g   Q h\	        V4      P                  R4      '       g   Q h\        R\        4       4      pVP                  R8X  g   Q hVP                  V 8X  g   Q h\	        V4      P                  R4      '       g   Q hR# )rg  z/base/zHSubTreeFileSystem(base_path=/base/, base_fs=<pyarrow._fs.LocalFileSystemz/another/base/zPSubTreeFileSystem(base_path=/another/base/, base_fs=<pyarrow._fs.LocalFileSystemN)r   r   	base_pathbase_fsrepr
startswith)r   subfss     r    test_subtree_filesystemru  o  s    Ggw/E??h&&&==G###;!! #I J J J J .0ABE??....==G###;!! #J K K K Kr#   c                   2   a  ] tR tRt o R tR tR tRtV tR# )%_PickleModuleSubTreeFileSystemWrapperi  c                    Wn         R # r   pickle_module)r   rz  s   &&r    r!   ._PickleModuleSubTreeFileSystemWrapper.__init__  s    *r#   c                L    V P                   P                  \        R V4      4      # )r`   )rz  dumpsr   )r   objs   &&r    r}  +_PickleModuleSubTreeFileSystemWrapper.dumps  s!    !!''(9#s(CDDr#   c                L    V P                   P                  V4      P                  # r   )rz  loadsrq  )r   r   s   &&r    r  +_PickleModuleSubTreeFileSystemWrapper.loads  s    !!''-555r#   ry  N)	r   r   r   r   r!   r}  r  r   r   r   s   @r    rw  rw    s     +E6 6r#   rw  TFc                 D    VP                   pV'       d   \        V 4      # V # r   )r(  rw  )rz  r   wrap_with_subtree_filesystems   && r    *pickle_with_and_without_subtree_filesystemr    s"     $+== #4]CCr#   c                 ,   TpV P                   P                  R 4      R,          R8X  d   \        P                  ! RR7       VP	                  V 4      pVP                  V4      p\        V\        4      '       g   Q hVP                  V 4      '       g   Q hR# )::mock"MockFileSystem is not serializablerA  N)	rC  splitr   rD  r}  r  r&   r   rh  )r   r  rz  
serializedrestoreds   &&   r    test_filesystem_picklingr    sx    >M	||$#v-@A$$R(J"":.Hh
++++??2r#   c                    TpV P                   P                  R 4      R	,          R8X  d   \        P                  ! RR7       \	        V 4       V! R4      pV! R4      pV! R4      pV P                  V4       V P                  V4      ;_uu_ 4         RRR4       V P                  V4      ;_uu_ 4       pVP                  R4       RRR4       VP                  VP                  V 4      4      pVP                  WEV.4      w  rpV	P                  \        P                  8X  g   Q hV
P                  \        P                  8X  g   Q hVP                  \        P                  8X  g   Q hR#   + '       g   i     L; i  + '       g   i     L; i)
r  r  r  rA  	a/aa/aaa/a/bbc.txtNrN  r  )rC  r  r   rD  rE  rZ   r   rR  r  r}  rH   rZ  r   rB   rA   )r   r   r  rz  aaabbcfpr  aaa_infobb_infoc_infos   &&&         r    ,test_filesystem_is_functional_after_picklingr    s)    ?M	||$#v-@AR

C	BwAMM#			r	"	" 
#			q	!	!R
 
" ""=#6#6r#:;H ( 6 6| DHv==H.....<<8==(((;;(--''' 
#	"	!	!s   E&1E9&E6	9F		c                  z    \        4       p V P                  R 8X  g   Q h\        4       p V P                  R8X  g   Q hR# )localr  N)r   rC  r   r+  s    r    test_type_namer    s6    		B<<7"""		B<<6!!!r#   c                 6    V P                  R 4      R 8X  g   Q hR# )r[  N)r9   r+  s   &r    test_normalize_pathr    s     U#u,,,r#   c           	      "    ! R  R4      p^RV! 4       \        4       / . R \        P                  ! 4       .pV F?  p\        P                  ! \
        4      ;_uu_ 4        V P                  V4       RRR4       KA  	  R#   + '       g   i     KV  ; i)c                       ] tR tRtRtR# )-test_non_path_like_input_raises.<locals>.Pathi  r2   N)r   r   r   r   r   r2   r#   r    Pathr    s    r#   r  g?c                      ^# )   r2   r2   r#   r    r   1test_non_path_like_input_raises.<locals>.<lambda>  s    ar#   N)tuplepathlibr  r   rP  rc  rZ   )r   r  invalid_pathsr8   s   &   r    test_non_path_like_input_raisesr    sh      TVUWb"i\\^%M]]9%%MM$ &% %%%s   A==Bc                 h   V! R 4      pV! R4      pV! R4      pV! R4      pV P                  V4       V P                  V4      ;_uu_ 4         RRR4       V P                  V4      ;_uu_ 4       pVP                  R4       RRR4       V P                  W#WE.4      w  rxrVP                  V8X  g   Q hR\        V4      9   g   Q hVP                  R8X  g   Q hV P                  R8X  d#   VP                  \        P                  8X  g   Q hM3VP                  \        P                  8X  g   Q hR	\        V4      9   g   Q hVP                  e   Q h\        V4       VP                  \        V4      8X  g   Q hVP                  R
8X  g   Q hVP                  R8X  g   Q hVP                  \        P                   8X  g   Q hR\        V4      9   g   Q hVP                  ^ 8X  g   Q hV P                  R9  d   \#        V4       V	P                  \        V4      8X  g   Q hV	P                  R8X  g   Q hV	P                  R8X  g   Q hV	P                  \        P                   8X  g   Q hR\        V	4      9   g   Q hV	P                  ^8X  g   Q hV P                  R9  d   \#        V	4       V
P                  \        V4      8X  g   Q hV
P                  R8X  g   Q hV
P                  R8X  g   Q hV
P                  \        P                  8X  g   Q hV
P                  e   Q hV
P$                  e   Q hR\        V
4      9   g   Q h\'        V
4       V P                  V4      pVP                  VP                  8X  g   Q hVP                  VP                  8X  g   Q hR#   + '       g   i     ELH; i  + '       g   i     EL); i)r  r  r  zzzNrN  r   r@  zFileType.Directoryr  zFileType.FiletxtzFileType.NotFound)zpy::fsspec+memoryr@  )rZ   r   rR  rH   r8   rr  	extensionrC  rZ  r   rC   rB   rM   r>  r   r^  rA   r9  r1  r<  )r   r   r  r  r  r  r  r  r  r  zzz_info	aaa_info2s   &&          r    test_get_file_infor    s*   

C	BwA
-CMM#			r	"	" 
#			q	!	!R
 
" +-*:*:CQ;L*M'Hv==CDN"""###	||11}} 1 1111}} 2 2222#tH~555==   (#<<3r7"""$$$"""<<8==(((d7m+++<<1	||LLG;;#a&   w&&&u$$$;;(--'''d6l***;;!	||LLF==CH$$$&&&###==H-----==   >>!!!$x.000x    %I==INN***==INN***c 
#	"	"	!	!	!s   N.N N	 N1	c                 @   V! R 4      pV! R4      pV! R4      pV! R4      pV! R4      pV! R4      p V P                  V4       V P                  V4      ;_uu_ 4         RRR4       V P                  V4      ;_uu_ 4         RRR4       V P                  V4       V P                  V4      ;_uu_ 4         RRR4       V P                  V4       \        VRRR	7      pVP                  V8X  g   Q hV P	                  V4      p	V P
                  R
8X  d   \        V	4      ^8H   M\        V	4      ^8X  g   Q hV	 EF.  p
V
P                  P                  V4      '       gC   V
P                  P                  V4      '       g"   V
P                  P                  V4      '       d#   V
P                  \        P                  8X  g   Q hMV
P                  P                  R4      P                  V4      '       g1   V
P                  P                  R4      P                  V4      '       d#   V
P                  \        P                  8X  g   Q hM\        RV
P                   24      h\        V
4       EK1  	  \        VRR7      pV P	                  V4      p	V P
                  R
8X  d   \        V	4      ^8X  g   Q hM\        V	4      ^8X  g   Q hV P!                  V4       R#   + '       g   i     ELy; i  + '       g   i     ELj; i  + '       g   i     ELJ; i  T P!                  T4       i ; i)zselector-dir/zselector-dir/test_file_azselector-dir/test_file_bzselector-dir/test_dir_az#selector-dir/test_dir_a/test_file_czselector-dir/test_dir_bNFT)rQ   rS   r@  r`   zunexpected path rS   )rZ   r   r   rP   rH   rC  lenr8   endswithrZ  r   rA   rstriprB   rc   r>  r]   )r   r   rP   file_afile_bdir_afile_cdir_brT   rU   rG   s   &&         r     test_get_file_info_with_selectorr    sw   o&H./F./F,-E9:F,-E- 
h""6** +""6** +
e""6** +
e  %*.0  H,,,  *<<55J!Ou:?"?D		""6**dii.@.@.H.HII&&v..yyHMM111))""3'0077))""3'0077yyH$6$6666 #3DII;!?@@!$'   E:  *<<55u:?"?u:?"? 	hW +***** +**L 	hsn   *L
 K!L
 ?K"2L
 3K65CL
 : L
 AL
 -/L
 BL
 K		L
 "K3	-	L
 6L		L
 
Lc                 z   \        V 4       V! R 4      p\        P                  ! \        P                  4      ;_uu_ 4        V P                  V4       RRR4       V P                  V4       V P                  V4       V! R4      pV P                  VRR7       V P                  V4       R#   + '       g   i     L`; i)ztest-directory/Nzdeeply/nested/test-directory/Tr  )rE  r   rP  r}   rQ  r]   rZ   )r   r   ds   && r    test_create_dirr  C  s     R !A	r	'	'
a 
( MM!MM!./AMM!tM$MM! 
(	's    B**B:	c                    \        V 4       V! R 4      pV! R4      pV P                  V4       V P                  V4       \        P                  ! \
        P                  4      ;_uu_ 4        V P                  V4       RRR4       \        P                  ! \
        P                  4      ;_uu_ 4        V P                  V4       RRR4       R#   + '       g   i     LX; i  + '       g   i     R# ; i)
directory/directory/nested/N)rE  rZ   r]   r   rP  r}   rQ  r   r   r  nds   &&  r    test_delete_dirr  T  s    R|A	#	$BMM"MM!	r	'	'
b 
(	r	'	'
a 
(	' 
(	'	'	'	's   *C0CC	C0	c                    \        V 4       V! R 4      pV! R4      pV P                  V4       V P                  V4       V P                  V4       V P                  V4      pVP                  \
        P                  8X  g   Q hV! R4      pV! R4      pV! R4      pV P                  V4       V P                  V4       V P                  V4      ;_uu_ 4       pVP                  R4       RRR4       V P                  V4       V P                  V4      pVP                  \
        P                  8X  g   Q hR#   + '       g   i     LU; i)r  r  
directory2zdirectory2/nestedzdirectory2/nested/target-file   dataN)	rE  rZ   r]   rH   rZ  r   rC   r   rR  )r   r   r  r  dir_inforT  ss   &&     r    $test_delete_dir_with_explicit_subdirr  b  s   
 R|A	#	$B MM!MM"MM!"H==H----- 	|A	#	$B./AMM!MM"			q	!	!Q	 
" MM!"H==H----- 
"	!s   D33E	c                    \        V 4       V! R 4      pV! R4      pV P                  V4       V P                  V4       \        P                  ! \
        P                  4      ;_uu_ 4        V P                  V4       RRR4       V P                  VRR7       \        P                  ! \
        P                  4      ;_uu_ 4        V P                  V4       RRR4       V P                  V4       \        P                  ! \
        P                  4      ;_uu_ 4        V P                  V4       RRR4       R#   + '       g   i     L; i  + '       g   i     L|; i  + '       g   i     R# ; i)r  r  NT)rd   )rE  rZ   ra   r   rP  r}   rQ  r]   r  s   &&  r    test_delete_dir_contentsr    s    R|A	#	$BMM"1	r	'	'
b 
(2d3	r	'	'
r" 
(MM!	r	'	'
a 
(	' 
(	' 
(	' 
(	'	's$   *D6E	E6E		E	E-	c                    V R ,          pV R,          pV! R4      pV! R4      pVP                  V4       \        P                  ! \        P                  4      ;_uu_ 4        VP                  R4       RRR4       \        P                  ! \        P                  4      ;_uu_ 4        VP                  R4       RRR4       \        P                  ! \        P                  4      ;_uu_ 4        VP                  R4       RRR4       VP                  RRR	7       VP                  RRR	7       VP                  RRR	7       \        P                  ! \        P                  4      ;_uu_ 4        VP                  V4       RRR4       R#   + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)
r   r   r  r  r  Nr`   //Taccept_root_dir)rZ   r   rP  r}   ArrowInvalidra   rQ  r]   )r   r   r   r  r  s   &    r    _check_root_dir_contentsr    s0   	BHF|A	#	$BMM"	r	'	'
r" 
(	r	'	'
s# 
(	r	'	'
t$ 
( 2t43546	r	'	'
a 
(	' 
(	'	'	'	'	'	' 
(	'	's0    F&F,F.+GF	F+	.F>	G	c                 2    \        V 4       \        V4       R # r   )r  )r   r   s   &&r    test_delete_root_dir_contentsr    s    V$Y'r#   c                     V! R 4      pV! R4      pV P                  V4      ;_uu_ 4         RRR4       V P                  W#4       V P                  V4       V P                  V4       R#   + '       g   i     LE; i)ztest-copy-source-fileztest-copy-target-fileN)r   rw   rj   r   r   r  ts   &&  r    test_copy_filer    s`    &'A&'A			q	!	! 
" LLNN1NN1 
"	!s   A))A9	c                    \        V R 4       V! R4      pV! R4      pV P                  V4       V'       dk   V P                  W44       \        P                  ! \
        P                  4      ;_uu_ 4        V P                  V4       RRR4       V P                  V4       R# \        P                  ! \
        P                  4      ;_uu_ 4        V P                  W44       RRR4       R#   + '       g   i     Lk; i  + '       g   i     R# ; i).Not implemented yet in for Azure. See GH-40025zsource-dir/ztarget-dir/N)rH  rZ   rr   r   rP  r}   rQ  r]   )r   r   r   r  r  s   &&&  r    test_move_directoryr    s    rCD 	}A}AMM!
]]2??++MM! ,
a]]2??++GGAM ,+	 ,+ ,++s   3C(C;(C8	;D	c                    \        V 4       \        V R 4       V! R4      pV! R4      pV P                  V4      ;_uu_ 4         RRR4       V P                  W#4       \        P
                  ! \        P                  4      ;_uu_ 4        V P                  V4       RRR4       V P                  V4       R#   + '       g   i     Lz; i  + '       g   i     L6; i)r  ztest-move-source-fileztest-move-target-fileN)	rE  rH  r   rr   r   rP  r}   rQ  rj   r  s   &&  r    test_move_filer    s     R rCD&'A&'A			q	!	! 
" GGAM	r	'	'
q 
(NN1 
"	! 
(	's   B5C5C	C	c                 F   V! R 4      pV P                  V4      ;_uu_ 4         RRR4       V P                  V4       \        P                  ! \        P
                  4      ;_uu_ 4        V P                  V4       RRR4       V! R4      pV P                  V4       V! R4      pV P                  V4      ;_uu_ 4       pVP                  R4       RRR4       V P                  V4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     LI; i)ztest-delete-target-fileNztest-delete-nestedztest-delete-nested/target-filer  )	r   rj   r   rP  r}   rQ  rZ   rR  r]   )r   r   r   r  rT  r  s   &&    r    test_delete_filer    s    ()A			q	!	! 
" NN1	r	'	'
q 
( 	#$AMM!/0A			q	!	!Q	 
" MM! 
"	! 
(	' 
"	!s#   C*)C==D*C:	=D	D 	c                     V # r   r2   )vs   &r    identityr    s    Hr#   gzip   c                 ^   V! R 4      pRR,          pV P                  V4      ;_uu_ 4       pVP                  V! V4      4       RRR4       V P                  WRV4      ;_uu_ 4       pVP                  4       pRRR4       XV8X  g   Q hR#   + '       g   i     LN; i  + '       g   i     L.; i)zopen-input-streams   some data for reading
   N)r   rR  r   read)	r   r   compressionbuffer_size
compressorr   r   r  results	   &&&&&    r    test_open_input_streamr    s     	"#A%+D			q	!	!Q	
4 ! 
" 
		ak	:	:a 
; T>> 
"	! 
;	:s   B	%B	B	B,	c                 6   V! R 4      pRR,          pV P                  V4      ;_uu_ 4       pVP                  V4       RRR4       \        R4      R,          pV P                  V4      ;_uu_ 4       pVP	                  4       pRRR4       XV8X  g   Q hV P                  V4      ;_uu_ 4       pVP                  V4       VP	                  4       pRRR4       WsVR 8X  g   Q hR#   + '       g   i     L; i  + '       g   i     L|; i  + '       g   i     LC; i)zopen-input-file	   some data   Nr  )r   rR  r  r   r  seek)r   r   r   r   r  	read_fromrT  r  s   &&      r    test_open_input_filer    s     !A$D			q	!	!Q	 
" L!C'I			A		! 
T>>			A		!	y 
 )*%%%% 
"	! 
	 
	s#   C"0C5+"D"C2	5D	D	c                     V! R 4      p\         P                  ! \        4      ;_uu_ 4        V P                  V4       RRR4       R#   + '       g   i     R# ; i)zopen-input-stream-not-foundN)r   rP  rR   r   )r   r   r   s   && r     test_open_input_stream_not_foundr  $  s:    ,-A	(	)	)
Q 
*	)	)	)s   AA	c                 h   V! R 4      pRR,          pV P                  WRV4      ;_uu_ 4       pVP                  V4       RRR4       V P                  WRV4      ;_uu_ 4       pVP                  \	        V4      4      V8X  g   Q h RRR4       R#   + '       g   i     LW; i  + '       g   i     R# ; i)zopen-output-streams   some data for writingr  N)r   rR  r   r  r  )r   r   r  r  decompressorr   r   rT  s   &&&&&   r    test_open_output_streamr  +  s     	#$A#d*D			q{	;	;q	 
< 
		ak	:	:avvc$i D((( 
;	: 
<	; 
;	:	:s   B "B B	 B1	c                    V! R 4      pV! R4      pV P                  V4      ;_uu_ 4       p	V	P                  V4       RRR4       V'       d{   V P                  WrVR7      ;_uu_ 4       p
V
P                  R4       RRR4       V P                  V4      ;_uu_ 4       p
V
P	                  4       pRRR4       V! X4      pVR8X  g   Q hR# \
        P                  ! \        P                  4      ;_uu_ 4        V P                  WrVR7       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)zopen-append-streams   already existingN)r  r  s   
newly addeds   already existing
newly added)	r   rR  r   r   r  r   rP  r}   ArrowNotImplementedError)r   r   r  r  r  r  r   r   initialr  rT  r  s   &&&&&&&     r    test_open_append_streamr  A  s    	#$A,-G			q	!	!Q	 
" ""1/: # < <?@GG$%< !!!$$VVXF % f%9999]]26677!!!.9 " ; 87 
"	!< < %$ 877s/   D'D#D62E	D 	#D3	6E		E	c                 H   V! R 4      pRR/pRpV P                  W#R7      ;_uu_ 4       pVP                  V4       RRR4       V P                  V4      ;_uu_ 4       pVP                  4       V8X  g   Q hVP	                  4       pRRR4       V P
                  R9   g   RV P
                  9   dF   \        V R4       VP                  4        F#  w  rxXV,          VP                  4       8X  d   K#  Q h	  R# X/ 8X  g   Q hR#   + '       g   i     L; i  + '       g   i     L; i)	zopen-output-stream-metadataContent-Typezx-pyarrow/testr  r   Nr  zWAzure filesystem currently only returns system metadata not user metadata. See GH-40026)r   r   rG  )	r   rR  r   r  r   rC  rH  itemsr|   )	r   r   r   r   r   rT  got_metadatakr  s	   &&       r     test_open_output_stream_metadatar  c  s    ,-A 01HD			q		4	4	 
5 
		a	 	 Avvx4zz| 
! 
||,,",,0F %	& NN$DA?ahhj000 % r!!! 
5	4 
!	 s   C>(D>D	D!	c                      \        R R7       \        P                  ! \        4      ;_uu_ 4        \        R R7       RRR4       R#   + '       g   i     R# ; i)Fr   )xxxN)r   r   rP  rc  r2   r#   r    test_localfs_optionsr  z  s0    U#	y	!	!E" 
"	!	!	!s   AA	c                    V R ,          p\        4       ;_uu_ 4        VP                  R4       RRR4       \        4       ;_uu_ 4        VP                  R4       RRR4       \        4       ;_uu_ 4        VP                  RRR7       RRR4       \        4       ;_uu_ 4        VP	                  R4       RRR4       \        4       ;_uu_ 4        VP                  R4       RRR4       \        4       ;_uu_ 4        VP                  RR4       RRR4       \        4       ;_uu_ 4        VP                  RR4       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)r   z/non/existent/fileNz/non/existent/dirFr  z/non/existentz/xxx)r   r   r   rZ   r]   rj   rr   rw   )r   r   s   & r    test_localfs_errorsr	    s    
B		 	 
12 
!		 	 
23 
!		 	 
)U; 
!		 	 
)* 
!		 	 
*+ 
!		 	 
( 
!		 	 
_f- 
!	  
!	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 sS   EE4E,"E?F:F%'F8E	E)	,E<	?F	F"	%F5	8G		c                    V R ,          p\         P                  ! \        4      pVP                  pVP	                  VP                  4       VP                  4       .4      w  rEVP                  VP                  4       P                  8X  g   Q hVP                  VP                  4       P                  8X  g   Q h\        V4       VP                  VP                  4       P                  8X  g   Q h\        V4       R# )r   N)r  r  __file__parentrH   r   rM   statst_sizer2  st_mtime_nsr9  )r   r   	file_pathdir_pathr8  r  s   &     r    test_localfs_file_infor    s    	BX&IH,,i.@.@.B.6.?.?.A.C DY>>Y^^-55555!1!=!====	 ; ;;;;r#   c                     \         P                  ! R \        P                  4      p\	        V4      pVP                  R4      ;_uu_ 4         RRR4       VP                  R.4      w  pVP                  V8X  g   Q hR#   + '       g   i     L9; i)rW  r[  N)r   r\  r   r]  r   r   rH   r1  )r   r`  r   rG   s   &   r    test_mockfs_mtime_roundtripr    sj    			
HLL	9B		B			u	%	% 
&ug&FT:: 
&	%s   
A==B	c           
         T p^ RI Hp \        P                  ! 4       pV! RRVRRRRR7      p\	        WB4      '       g   Q hVP
                  R8X  g   Q hVP                  R8X  g   Q hVP                  VP                  V4      4      V8X  g   Q hV! 4       p\	        WB4      '       g   Q hVP                  VP                  V4      4      V8X  g   Q hV! R	R
7      p\	        WB4      '       g   Q hVP                  VP                  V4      4      V8X  g   Q hV! RRRR/R7      p\	        WB4      '       g   Q hVP                  VP                  V4      4      V8X  g   Q h\        P                  ! \        4      ;_uu_ 4        V! RR7       RRR4       \        P                  ! \        4      ;_uu_ 4        V! R	RR7       RRR4       \        P                  ! \        4      ;_uu_ 4        V! R	RR7       RRR4       \        P                  ! \        4      ;_uu_ 4        V! \        P                  ! 4       R7       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)r   r   abczservice_account@apachezus-west2httpslocalhost:8999r   )access_tokentarget_service_accountcredential_token_expirationdefault_bucket_locationr   r   r   Tr   ACLauthenticated-readr  
text/plaindefault_metadataaccess)r  Nr   )r   r  acct)r   r  )r  )r   r   r   nowr&   r  r   r  r}  r   rP  rc   )r  rz  r   r`  r   s   &    r    test_gcs_optionsr&    s   >M(	B	E.F35/9%9I"3
5B b((((%%333==----}222672===	Bb((((}222672===		&Bb((((}222672===	0D)7)G 
HBb((((}222672===	z	"	"8, 
#	z	"	"8< 
#	z	"	"VD 
#	z	"	"(,,.A 
#	" 
#	"	"	"	"	"	"	"	"s0   :
H?.I#I%I8?I	I"	%I5	8J		c           	         T p^ RI HpHpHpHp V! RRRRRRR7      p\        Wd4      '       g   Q hVP                  R8X  g   Q hVP                  VP                  V4      4      V8X  g   Q hV! R	R
R^dR7      p\        Wd4      '       g   Q hVP                  VP                  V4      4      V8X  g   Q hV! V! ^R7      R7      p\        Wd4      '       g   Q hV! V! ^R7      R7      p\        Wd4      '       g   Q hV! R	R7      p\        Wt4      '       g   Q hVP                  VP                  V4      4      V8X  g   Q hWv8w  g   Q hV! RR7      p\        Wd4      '       g   Q hVP                  VP                  V4      4      V8X  g   Q hV! RR7      p\        Wd4      '       g   Q hVP                  VP                  V4      4      V8X  g   Q hV! RRRRR/R7      p\        Wt4      '       g   Q hVP                  VP                  V4      4      V8X  g   Q hWv8w  g   Q hV! RR7      p\        Wd4      '       g   Q hVP                  VP                  V4      4      V8X  g   Q hVP                  VP                  V4      4      V! 4       8w  g   Q hV! RRR7      p\        Wd4      '       g   Q hVP                  VP                  V4      4      V8X  g   Q hV! RRRR7      p\        Wd4      '       g   Q hVP                  VP                  V4      4      V8X  g   Q hV! RRR7      p\        Wd4      '       g   Q hVP                  VP                  V4      4      V8X  g   Q hV! RRR7      p\        Wt4      '       g   Q hVP                  VP                  V4      4      V8X  g   Q hWv8w  g   Q hV! RRR7      p\        Wd4      '       g   Q hVP                  VP                  V4      4      V8X  g   Q hV! RR 7      p\        Wd4      '       g   Q hVP                  VP                  V4      4      V8X  g   Q hWd! R!R 7      8w  g   Q hWd! 4       8w  g   Q h\        P                  ! \        4      ;_uu_ 4        V! RR"7       R#R#R#4       \        P                  ! \        4      ;_uu_ 4        V! RR$7       R#R#R#4       \        P                  ! \        4      ;_uu_ 4        V! RRR%7       R#R#R#4       \        P                  ! \        4      ;_uu_ 4        V! RRR&7       R#R#R#4       \        P                  ! \        4      ;_uu_ 4        V! RRR'R(7       R#R#R#4       \        P                  ! \        4      ;_uu_ 4        V! RRRR)7       R#R#R#4       \        P                  ! \        4      ;_uu_ 4        V! R'RR*7       R#R#R#4       \        P                  ! \        4      ;_uu_ 4        V! R+R,.R-7       R#R#R#4       \        P                  ! \        4      ;_uu_ 4        V! V! 4       R7       R#R#R#4       R##   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL_; i  + '       g   i     EL=; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R## ; i).r   )AwsDefaultS3RetryStrategyAwsStandardS3RetryStrategyr   S3RetryStrategyr#  r   token	us-east-2r  r  )r   r   session_tokenregionr   r   rolesessionr#  )role_arnsession_nameexternal_idload_frequency)max_attempts)retry_strategy)r1  Tr  )background_writesr  r  r  r   )r7  r"  )allow_delayed_open)r   r   )r   r   )check_directory_existence_before_creationg      ?g      ?)request_timeoutconnect_timeout)r   force_virtual_addressingzca.pem)tls_ca_file_pathzother_ca.pem)r   N)r   )r   r-  )r   r-  arn)r   r   r1  )r   r   r   )r1  r   r[  rY  r!  )r   r(  r)  r   r*  r&   r.  r  r}  r   rP  rc   )r  rz  r(  r)  r   r*  r   rk  s   &       r    test_s3_optionsr?    s   >M- - 
h$+K$8H
JB b''''99###}222672===	vI"&s
<Bb''''}222672=== 
1qA
CBb''''	0a@
BBb''''

'Cc((((}22378C???99		%Bb''''}222672===		-Bb''''}222672===
).0D)7)GHC c((((}22378C???99		.Bb''''}222672===}22267<>III	D	MBb''''}222672===	D@D
FBb''''}222672===	c4	@Bb''''}222672===
tS
ACc((((}22378C???99	(8SW	XBb''''}222672===	x	0Bb''''}222672===~>>>>	z	"	") 
#	z	"	") 
#	z	"	"@ 
#	z	"	"@ 
#	z	"	"Hu	
 
# 
z	"	"H	
 
# 
z	"	"et4 
#	z	"	"uen5 
#	z	"	"O$56 
#	") 
#	"	"	"	"	"	"	"	"	"	"	"	"	"	" 
#	"	" 
#	"	"	"	"	"	"sl   $
X&
X:YY"6Y6,Z
"ZZ1[&X7	:Y	Y	"Y3	6Z	
Z	Z.	1[	[	c           
      L   Tp^ RI Hp RRRRRR/pRpRR	RRRR
/pRpV! VR7      p\        W4      '       g   Q hVP                  VP	                  V4      4      V8X  g   Q hV! VR7      p\        W4      '       g   Q hVP                  VP	                  V4      4      V8X  g   Q hV! VR7      p\        W4      '       g   Q hVP                  VP	                  V4      4      V8X  g   Q hV! VR7      p\        W4      '       g   Q hVP                  VP	                  V4      4      V8X  g   Q hV! VR7      p	V! VR7      p
W8X  g   Q hVP                  VP	                  V	4      4      V
8X  g   Q hVP                  VP	                  V
4      4      V	8X  g   Q hV! VR7      p	V! VR7      p
W8X  g   Q hVP                  VP	                  V	4      4      V
8X  g   Q hVP                  VP	                  V
4      4      V	8X  g   Q hV! VR7      p	V! VR7      p
W8X  g   Q hVP                  VP	                  V	4      4      V
8X  g   Q hVP                  VP	                  V
4      4      V	8X  g   Q hV! VR7      p	V! VR7      p
W8X  g   Q hVP                  VP	                  V	4      4      V
8X  g   Q hVP                  VP	                  V
4      4      V	8X  g   Q hV! VR7      p	V! VR7      p
W8X  g   Q hVP                  VP	                  V	4      4      V
8X  g   Q hVP                  VP	                  V
4      4      V	8X  g   Q hV! VR7      p	V! VR7      p
W8X  g   Q hVP                  VP	                  V	4      4      V
8X  g   Q hVP                  VP	                  V
4      4      V	8X  g   Q hV! VR7      p	V! VR7      p
W8w  g   Q hVP                  VP	                  V	4      4      V
8w  g   Q hVP                  VP	                  V
4      4      V	8w  g   Q hV! VR7      p	V! VR7      p
W8w  g   Q hVP                  VP	                  V	4      4      V
8w  g   Q hVP                  VP	                  V
4      4      V	8w  g   Q hV! VR7      p	V! VR7      p
W8w  g   Q hVP                  VP	                  V	4      4      V
8w  g   Q hVP                  VP	                  V
4      4      V	8w  g   Q hV! VR7      p	V! VR7      p
W8w  g   Q hVP                  VP	                  V	4      4      V
8w  g   Q hVP                  VP	                  V
4      4      V	8w  g   Q hV! VR7      p	V! 4       p
W8w  g   Q hVP                  VP	                  V	4      4      V
8w  g   Q hVP                  VP	                  V
4      4      V	8w  g   Q hV! VR7      p	V! 4       p
W8w  g   Q hVP                  VP	                  V	4      4      V
8w  g   Q hVP                  VP	                  V
4      4      V	8w  g   Q hV! VR7      p	V! 4       p
W8w  g   Q hVP                  VP	                  V	4      4      V
8w  g   Q hVP                  VP	                  V
4      4      V	8w  g   Q hV! VR7      p	V! 4       p
W8w  g   Q hVP                  VP	                  V	4      4      V
8w  g   Q hVP                  VP	                  V
4      4      V	8w  g   Q h\
        P                  ! \        4      ;_uu_ 4        V! RR7       RRR4       \
        P                  ! \        4      ;_uu_ 4        V! RRRR/R7       RRR4       \
        P                  ! \        4      ;_uu_ 4        V! RR	RR/R7       RRR4       \
        P                  ! \        4      ;_uu_ 4        V! RRRR/R7       RRR4       \
        P                  ! \        P                  4      ;_uu_ 4        V! RR7       RRR4       \
        P                  ! \        P                  4      ;_uu_ 4        V! RRRRRR/R7       RRR4       R#   + '       g   i     EL=; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)r   r   r   r   r   	localhostr   i'#  zhttp://localhost:8999r  i  zhttps://localhost:8080)proxy_options#  NzhttpsB://localhost:9000httpA)r   rA  rC  )r   r   r&   r  r}  r   rP  rc  KeyErrorr}   r  )monkeypatchr  rz  r   proxy_opts_1_dictproxy_opts_1_strproxy_opts_2_dictproxy_opts_2_strr   rj  rk  s   &&         r    test_s3_proxy_optionsrK  >  s   >M' "66;M.!7FKN/ 
$5	6Bb''''}222672===	$5	6Bb''''}222672=== 
$4	5Bb''''}222672===	$4	5Bb''''}222672=== %6
7C
%6
7C::}22378C???}22378C???
%6
7C
%6
7C::}22378C???}22378C??? %5
6C
%5
6C::}22378C???}22378C???
%5
6C
%5
6C::}22378C???}22378C??? %6
7C
%5
6C::}22378C???}22378C???
%6
7C
%5
6C::}22378C???}22378C??? %6
7C
%6
7C::}22378C???}22378C???
%6
7C
%5
6C::}22378C???}22378C???
%5
6C
%6
7C::}22378C???}22378C???
%5
6C
%5
6C::}22378C???}22378C??? %6
7C
.C::}22378C???}22378C???
%5
6C
.C::}22378C???}22378C???
%6
7C
.C::}22378C???}22378C???
%5
6C
.C::}22378C???}22378C??? 
y	!	!#>? 
" 
x	 	 FK#FG 
! 
x	 	 Hgvt#DE 
! 
x	 	 Hffk#JK 
! 
r	'	'#<= 
( 
r	'	'Hgv{$*D$2 	3 
(	' 
"	!	! 
!	 	  
!	  
!	  
(	' 
(	'	'sH   3
`1'aaa,
a?b1a	a	a)	,a<	?b	b#	c                  :   ^ RI Hp  V ! RRR7      pRp\        P                  ! \        VR7      ;_uu_ 4       pVP                  R4       RRR4       R	\        XP                  4      9   d   R# V ! R
RR7      pVP                  R4       R#   + '       g   i     LI; i)r   r   z
eu-north-1T)r.  r   zWhen getting information for bucket 'arrow-datasets': AWS Error UNKNOWN \(HTTP status 301\) during HeadBucket operation: No response body. Looks like the configured region is 'eu-north-1' while the bucket is located in 'us-east-1'.|NETWORK_CONNECTIONrL  arrow-datasetsNNETWORK_CONNECTION	us-east-1)r   r   r   rP  r   rH   r   r   )r   r   msgexcs       r    test_s3fs_wrong_regionrR    s|    ' 
\T	:B!C
 
wc	*	*c
)* 
+ s399~-	[D	9B%& 
+	*s   B

B	c           	         T p^ RI Hp V! RR7      p\        W24      '       g   Q hVP                  VP	                  V4      4      V8X  g   Q hV! RRR7      p\        WB4      '       g   Q hVP                  VP	                  V4      4      V8X  g   Q hWC8w  g   Q hV! RRRR	R
R
R7      p\        WR4      '       g   Q hVP                  VP	                  V4      4      V8X  g   Q hWT8w  g   Q hV! RRR7      p\        Wb4      '       g   Q hVP                  VP	                  V4      4      V8X  g   Q hWe8w  g   Q hV! RRRRR7      p\        Wr4      '       g   Q hVP                  VP	                  V4      4      V8X  g   Q hWv8w  g   Q hV! RRR7      p\        W4      '       g   Q hVP                  VP	                  V4      4      V8X  g   Q hW8w  g   Q h\
        P                  ! \        RR7      ;_uu_ 4        V! RRR7       RRR4       \
        P                  ! \        RR7      ;_uu_ 4        V! RRR7       RRR4       Rp	\
        P                  ! \        V	R7      ;_uu_ 4        V! RRRR7       RRR4       \
        P                  ! \        RR7      ;_uu_ 4        V! RRRR7       RRR4       \
        P                  ! \        V	R7      ;_uu_ 4        V! RRRR7       RRR4       \
        P                  ! \        4      ;_uu_ 4        V! RRRR7       RRR4       \
        P                  ! \        4      ;_uu_ 4        V! 4        RRR4       R#   + '       g   i     EL\; i  + '       g   i     EL9; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)r   r   zfake-account-name)r   fakeaccountkey)r   r   zfake-accountfakeaccountzfake-blob-authorityzfake-dfs-authorityr  r   fakesastoken)r   	sas_tokenzfake-tenant-idzfake-client-idzfake-client-secret)r   	tenant_id	client_idclient_secret)r   rY  zclient_id must be specifiedrL  )r   rX  N)r   rZ  zInvalid Azure credential configuration: For ManagedIdentityCredential, provide only client_id. For ClientSecretCredential, provide tenant_id, client_id, and client_secret.)r   rY  rZ  )r   rX  rZ  )r   rX  rY  )r   r   rW  )	r   r   r&   r  r}  r   rP  rc   rc  )
r  rz  r   rj  rk  fs3fs4fs5fs6invalid_msgs
   &         r    test_azurefs_optionsr`    sU   >M*
':
;Cc++++}22378C???
':&68Cc++++}22378C???::
~=1F0D.5-4	6C
 c++++}22378C???::
':$24Cc++++}22378C???::
(""*	C c++++}22378C???::
("C c++++}22378C???::	z)F	G	G,&	
 
H 
z)F	G	G,.	
 
H	W  
z	5	5,&.	
 
6 
z)F	G	G,&.	
 
H 
z	5	5,&&	
 
6 
z	"	"%8m"0	2 
# 
y	!	! 
"	!W 
H	G	G 
H	G	G 
6	5	5 
H	G 
6	5 
#	" 
"	!	!sT   2M)M$"M8NNN2>OM!	$M5	8N		N	N/	2O	O	c                    Tp^ RI Hp \        P                  ! 4       '       g   \        P
                  ! R4       V w  rEp^pRpRp	Rp
V! WERWxV	R7      pVP                  V
P                  WERWxV	4      4      pVP                  V
P                  WERWxV	4      4      pVP                  V
P                  WERV^,           W4      4      pV! WE4      pVP                  RV RV 24      pV! WER	R
7      pV! WER	RR7      pV! WER	\        P                  ! R4      R7      pV! WER	RR7      pV! WER	RRR/R7      pW8X  g   Q hVV8X  g   Q hVV8w  g   Q hW8w  g   Q hW8w  g   Q hVV8w  g   Q hW8w  g   Q hW8w  g   Q hVV8w  g   Q hVV8X  g   Q hVV8w  g   Q hVV8w  g   Q h\        P                  ! \        4      ;_uu_ 4        V! 4        RRR4       \        P                  ! \        4      ;_uu_ 4        VP                  ^4       RRR4       WWVVVVVVV3 F*  pVP                  VP                  V4      4      V8X  d   K*  Q h	  V w  rEpV! WEVR
7      pVP                  \        R4      4      '       g   Q hVP                  RV RV RV 24      pVP                  \        R4      4      '       g   Q hR#   + '       g   i     L; i  + '       g   i     L; i)r   r  r  zIhdfs://{}:{}/?user={}&replication={}&buffer_size={}&default_block_size={}libhdfs)r	  replicationr  default_block_sizemezhdfs://r   	localuser)r	  
cache_path)r	  kerb_ticketcache_path2
hdfs_tokenabcd)r	  rh  
extra_confNr`   z/?user=i   i   )r   r  r}   r  r   r   from_uriformatr  r  rP  rc  r  r}  rH   r   )r  r  rz  r  r   r   r	  rc  r  rd  urihdfs1hdfs2hdfs3hdfs4hdfs5hdfs6hdfs7hdfs8hdfs9hdfs10hdfs11r   r  s   &&                      r    test_hdfs_optionsr{  C  s   >M+??+,&DKK$$C Ti)40BDE %%cjjI{9K' E %%cjjD+4F' E %%cjjD+/;' E T(E%%vQtf&=>ETk:ETk)57ETk)0l)CEEd{*79Fd{*6*6)?AF >>E>>E>>>>>>E>>>>>>E>>E>>U??U??	y	!	! 
"	y	!	!!!!$ 
" U5%ff&""=#6#6r#:;rAAA& 'DDT2Dl3/0000$$
$qgdV,D l3/0000# 
"	!	!	!s   8J,*J?,J<	?K	zmock:r  zmock:foo/barrX  zmock:/foo/barzmock:///foo/barzmock:///some%20path/%C3%A9u   some path/éfile:/r`   zfile:///zfile:/foo/barz/foo/barzfile:///foo/barzfile:///some%20path/%C3%A9u   /some path/éu   /some path/%20éc                 l    \         P                  ! V 4      w  r4\        W14      '       g   Q hWB8X  g   Q hR # r   )r   rm  r&   )ro  expected_klassexpected_pathr   r8   s   &&&  r    test_filesystem_from_urir    s3    & ""3'HBb))))   r#   c                  f   \         P                  ! R 4      w  r\        V \        4      '       g   Q hVR8X  g   Q h\         P                  ! R R7      w  r\        V \        4      '       g   Q hVR8X  g   Q h\        4       P                  R R7      w  r\        V \        4      '       g   Q hVR8X  g   Q hR# )r|  r`   )ro  N)r   rm  r&   r   )r   r8   s     r     test_filesystem_from_uri_callingr    s    ""8,HBb/****3;; ""x0HBb/****3;;  ))h)7HBb/****3;;r#   r8   c                     \         P                  ! V 4      p\        P                  ! V4      w  r \	        V\
        4      '       g   Q hWP                  4       P                  4       P                  4       8X  g   Q hR # r   )	r  r  r   rm  r&   r   resolveabsoluter   )r8   r   r   s   &  r     test_filesystem_from_path_objectr    s[    
 	TA""1%HBb/****99;'')224444r#   c           	      b   ^ RI Hp V R,          w  r#rERV RV RV RV R2	p\        P                  ! V4      w  rx\	        Wq4      '       g   Q hVR8X  g   Q hVP                  V4       VP                  V.4      w  p	V	P                  V8X  g   Q hV	P                  \        P                  8X  g   Q hR# )	r   r   r   s3://r   z0@mybucket/foo/bar?scheme=http&endpoint_override=z&allow_bucket_creation=Truemybucket/foo/barN)r   r   r   rm  r&   rZ   rH   r8   rZ  r   rB   )
r   r   r   r   r   r   ro  r   r8   rG   s
   &         r    test_filesystem_from_uri_s3r    s    ')2<)@&D
*Qzl +!F!D6)DFC ""3'HBb''''%%%%MM$tf%FT9999*****r#   c                 p   ^ RI Hp V R,          w  r#RRV RV R2,           R,           p\        P                  ! V4      w  rV\	        WQ4      '       g   Q hVR8X  g   Q hVP                  V4       VP                  V.4      w  pVP                  V8X  g   Q hVP                  \        P                  8X  g   Q hR	# )
r   r   r   zgs://anonymous@z/mybucket/foo/bar?scheme=http&endpoint_override=r   &z0retry_limit_seconds=5&project_id=test-project-idr  N)r   r   r   rm  r&   rZ   rH   r8   rZ  r   rB   )r   r   r   r   ro  r   r8   rG   s   &       r    test_filesystem_from_uri_gcsr    s    (L)JD<TF!D6KL=>C ""3'HBb((((%%%%MM$tf%FT9999*****r#   c                  >   \        4       p \        V 4      p\        V\        4      '       g   Q hVP                  R 8X  g   Q hVP                  V J g   Q h\
        P                  ! \        4      ;_uu_ 4        \        R4       RRR4       R#   + '       g   i     R# ; iz	py::dummyN)r   r   r&   rC  handlerr   rP  rc  )r  r   s     r    test_py_filesystemr    sp    nG	g	Bb,''''<<;&&&::   	y	!	!T 
"	!	!	!s   5BB	c                  >   \        ^4      p \        ^4      p\        ^4      p\        V 4      p\        V 4      p\        V4      p\        V4      pWCJg   Q hWTJg   Q hWeJg   Q hWC8X  g   Q hWT8w  g   Q hWe8X  g   Q hV\        4       8w  g   Q hV\        4       8w  g   Q hR# )r  N)r   r   r   rD   )handler1handler2handler3rj  rk  r[  r\  s          r    test_py_filesystem_equalityr    s    AHAHAH
x
 C
x
 C
x
 C
x
 C>>>>>>::::::/####&(??r#   c                    T p\        4       p\        V4      pVP                  V4      pVP                  V4      p\	        V\
        4      '       g   Q hWS8X  g   Q hVP                  V8X  g   Q hVP                  R 8X  g   Q hR# r  )r   r   r}  r  r&   r   r  rC  )r  rz  r  r   r  r  s   &     r    test_py_filesystem_picklingr    s}    >MnG	g	B$$R(J"":.Hh
++++>>w&&&,,,r#   c                  x   \        4       p \        V 4      p\        V\        4      '       g   Q h\        P                  ! V 4      pR p V! 4       f   Q hR pV! 4       e   Q h\        4       p \        V 4      p\        P                  ! V 4      pR p V! 4       VP
                  J g   Q hV! 4       f   Q hR pV! 4       e   Q hR # r   )r   r   r&   weakrefrefr  )r  r   wrs      r    test_py_filesystem_lifetimer    s    nG	g	Bb,''''	W	BG4	B4<< nG	g	B	W	BG42::4	B4<<r#   c                  "   \        4       p \        V 4      pVP                  R .4      w  pVP                  R 8X  g   Q hVP                  \
        P                  8X  g   Q hVP                  R.4      w  pVP                  R8X  g   Q hVP                  \
        P                  8X  g   Q hVP                  R.4      w  pVP                  R8X  g   Q hVP                  \
        P                  8X  g   Q h\        P                  ! \        4      ;_uu_ 4        VP                  R.4       RRR4       \        P                  ! \        4      ;_uu_ 4        VP                  R.4       RRR4       R#   + '       g   i     LO; i  + '       g   i     R# ; i)zsome/dirz	some/filer>   r?   Nr  )r   r   rH   r8   rZ  r   rB   rA   rC   r   rP  rc  rE   )r  r   rG   s      r     test_py_filesystem_get_file_infor  (  s-   nG	g	Bzl+FT99
"""99*****{m,FT99###99%%%zl+FT99
"""99)))))	y	!	!
)% 
" 
w		
%! 
 	 
"	! 
 		s   E*E=*E:	=F	c                     \        4       p \        V 4      p\        R R7      pVP                  V4      p\	        V4      ^8X  g   Q hV^ ,          P
                  R8X  g   Q hV^ ,          P                  \        P                  8X  g   Q hV^ ,          P                  ^{8X  g   Q hV^,          P
                  R8X  g   Q hV^,          P                  \        P                  8X  g   Q hV^,          P                  e   Q h\        R RR7      pVP                  V4      p\	        V4      ^8X  g   Q hV^ ,          P
                  R8X  g   Q hV^,          P
                  R8X  g   Q hV^,          P
                  R8X  g   Q h\        RR7      p\        P                  ! \        4      ;_uu_ 4        VP                  V4       RRR4       \        RRR	7      pVP                  V4      . 8X  g   Q hR#   + '       g   i     L7; i)
rK   )rP   rL   rN   NT)rP   rS   rO   r>   )rP   rQ   )r   r   r   rH   r  r8   rZ  r   rA   rM   rB   r   rP  rR   )r  r   rT   rU   s       r    )test_py_filesystem_get_file_info_selectorr  ?  s   nG	g	BY/HX&Eu:??8==O+++8==HMM)))8==C8==----8==H.....8==   Y$?HX&Eu:??8==O+++8==----8==3333Z0H	(	)	)
" 
* ZFHH%+++	 
*	)s   &G''G7	c                     \        4       p \        V 4      pVP                  R RR7       VP                  RRR7       \        P                  ! \
        4      ;_uu_ 4        VP                  R4       RRR4       VP                  R4       VP                  R4       R FR  p\        P                  ! \        4      ;_uu_ 4        VP                  V4       RRR4       VP                  VRR	7       KT  	  VP                  R
4       VP                  RR4       VP                  RR4       R#   + '       g   i     L; i  + '       g   i     Lq; i)rS   Tr  rY   FfoobarNr]   ra   r  rj   rm   rn   ru   rv   )r  r`   r  )r   r   rZ   r   rP  rE   r]   ra   rc   rj   rr   rw   )r  r   r8   s      r    test_py_filesystem_opsr  \  s    nG	g	BMM+M.MM/UM3	w		
h 
  MM,01]]:&&""4( '
tT:   NN=!GGK#LL!>2 
 	 '&s   D)D<)D9	<Ec                  f   \        \        4       4      p V P                  R 4      ;_uu_ 4       pVP                  4       R8X  g   Q h RRR4       \        P
                  ! \        4      ;_uu_ 4        V P                  R4       RRR4       R#   + '       g   i     LN; i  + '       g   i     R# ; i)somefiles   somefile:input_streamNr>   )r   r   r   r  r   rP  rR   r   rT  s     r    test_py_open_input_streamr  p  st    	ln	%B			j	)	)Qvvx3333 
*	(	)	)
Z( 
*	) 
*	)	)	)	)   B0BB	B0	c                  f   \        \        4       4      p V P                  R 4      ;_uu_ 4       pVP                  4       R8X  g   Q h RRR4       \        P
                  ! \        4      ;_uu_ 4        V P                  R4       RRR4       R#   + '       g   i     LN; i  + '       g   i     R# ; i)r  s   somefile:input_fileNr>   )r   r   r   r  r   rP  rR   r  s     r    test_py_open_input_filer  y  st    	ln	%B			J	'	'1vvx1111 
(	(	)	)
:& 
*	) 
(	'	)	)	)r  c                      \        \        4       4      p V P                  R 4      ;_uu_ 4       pVP                  R4       RRR4       R#   + '       g   i     R# ; ir  r  N)r   r   r   rR  r  s     r    test_py_open_output_streamr    <    	ln	%B			z	*	*a	 
+	*	*	*   A		A	c                      \        \        4       4      p V P                  R 4      ;_uu_ 4       pVP                  R4       RRR4       R#   + '       g   i     R# ; ir  )r   r   r   rR  r  s     r    test_py_open_append_streamr    r  r  c                     ^ RI Hp  \        P                  P	                  R4      ;'       g    RpV ! RR7      pVP
                  V8X  g   Q hV ! RRR7      pVP                  \        R4      4      p\        V4      ^ 8  g   Q hRpVP                  V4      ;_uu_ 4       pVP                  4       pR	V9   g   Q hVR
,          R8X  g   Q hVR,          R8X  g   Q h RRR4       R#   + '       g   i     R# ; i)r   r   PYARROW_TEST_S3_REGIONrO  Tr  )r   r.  zarrow-datasets/nyc-taxiz8arrow-datasets/nyc-taxi/year=2019/month=6/part-0.parquetr  zLast-Modifieds   2025-11-26T10:28:55ZETags%   "4c6a76826a695c6ac61592bc30cda3df-16"N)r   r   osenvirongetr.  rH   r   r  r   r   )r   default_regionr   entriesr  rT  mds          r    test_s3_real_awsr    s     (jjnn%=> " "! 		%B99&&&	[	9B|! # $Gw<!
DC			c	"	"aZZ\###/"&==== &zEEEE 
#	"	"	"s   :C""C3	c                  B   \         P                  ! R 4      w  rV P                  R8X  g   Q hV P                  V4      ;_uu_ 4       pRVP	                  ^24      9   g   Q h RRR4       \         P                  ! R4      w  rV P                  R8X  g   Q h\
        P                  ! \        RR7      ;_uu_ 4        \         P                  ! R4       RRR4       \         P                  ! R	4      w  rV P                  R
8X  g   Q h\         P                  ! R4      w  rV P                  V4      p\
        P                  ! \        4      ;_uu_ 4        VP                  4        RRR4       R#   + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     R# ; i)zs3://mf-nwp-models/README.txt	eu-west-1s&   Meteo-France Atmospheric models on AWSNz.s3://mf-nwp-models/README.txt?region=us-east-2r,  zBucket '.*' not foundrL  z s3://x-arrow..nonexistent-bucketz0s3://x-arrow-nonexistent-bucket?region=us-east-3z	us-east-3zMs3://x-arrow-nonexistent-bucket/T.md?region=us-east-2&allow_delayed_open=true)
r   rm  r.  r   r  r   rP  rE   r   close)r   r8   rT  streams       r    !test_s3_real_aws_region_selectionr    s6    ""#BCHB99###			d	#	#q8AFF2JFFF 
$ ""8:HB99### 
w&=	>	>>? 
?""#UVHB99###
 ""WYHB""4(F	w		 
 	1 
$	#	# 
?	> 
 		s$   E&6E:F&E7	:F
	F	c                  p   ^ RI Hp  V ! R4      R8X  g   Q hV ! R4      R8X  g   Q h\        P                  ! \        RR7      ;_uu_ 4        V ! R4       R	R	R	4       \        P                  ! \        RR7      ;_uu_ 4        V ! R
4       R	R	R	4       R	#   + '       g   i     LG; i  + '       g   i     R	# ; i)r   resolve_s3_regionrM  rO  zmf-nwp-modelsr  zNot a valid bucket namerL  rX  Nz	s3:bucket)r   r  r   rP  rc   r  s    r    test_resolve_s3_regionr    s    ,-.+===_-<<<	z)B	C	C)$ 
D	z)B	C	C+& 
D	C 
D	C	C	C	Cs   		B>	B$B!	$B5	c           
      ^   VR ,          pVR,          pV! R4      pVP                  V4      ;_uu_ 4       pVP                  R4       RRR4       V w  rxrRV	 RV
 RV RV RV 2
p\        VR	,          4      p\        W4       \	        4       pVP                  V4      ;_uu_ 4       pVP                  4       R8X  g   Q h RRR4       \        VR
,          4      p\        W^VR7       VP                  V4      ;_uu_ 4       pVP                  4       R8X  g   Q h RRR4       \        VR,          4      p\        V4      p\        VV4       VP                  V4      ;_uu_ 4       pVP                  4       R8X  g   Q h RRR4       \        VR,          4      p\        VVVR7       VP                  V4      ;_uu_ 4       pVP                  4       R8X  g   Q h RRR4       \        VR,          4      p\        VV^RR7       VP                  V4      ;_uu_ 4       pVP                  4       R8X  g   Q h RRR4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELS; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     R# ; i)r   r   r  rN  Nr  r   @z?scheme=http&endpoint_override=zc_copied1.txtzc_copied2.txt)source_filesystemzc_copied3.txtzc_copied4.txt)destination_filesystemzc_copied5.txtF
chunk_sizeuse_threads)r   rR  r   r   r   r   r  r   )s3_connectionr   r   r   r   r8   rT  r   r   r   r   
source_urilocal_path1r   local_path2local_path3destination_urilocal_path4local_path5s   &&&                r    test_copy_filesr    s;   	dB(^F '?D			t	$	$	 
% *7&D


|1ZL$
)$q	8 
 g/0Kz'G		"	";	/	/1vvx7""" 
0 g/0KtB7		"	";	/	/1vvx7""" 
0 g/0K%k2Oz?+		"	";	/	/1vvx7""" 
0 g/0Kz;wG		"	";	/	/1vvx7""" 
0 g/0Kz;1%H		"	";	/	/1vvx7""" 
0	/U 
%	$	$ 
0	/	/ 
0	/	/ 
0	/	/ 
0	/ 
0	/	/sG   H8$I=I  I4:JJ8I		I	 I1	4J	J	J,	c                   a \        4       oV R ,          pVP                  4        SP                  \        VR,          4      4      ;_uu_ 4       pVP	                  R4       RRR4       SP                  \        VR,          4      4      ;_uu_ 4       pVP	                  R4       RRR4       V3R lpV R,          pVP                  4        \        \        V4      \        V4      4       V! V4       V R,          pVP                  4        \        \        V4      \        V4      SSR	7       V! V4       V R
,          pVP                  4        \        \        V4      4      p\        \        V4      4      p\        Wx4       V! V4       V R,          p	V	P                  4        \        W4       V! V	4       V R,          p
V
P                  4        \        W^RR7       V! V
4       R#   + '       g   i     EL; i  + '       g   i     EL]; i)sourcefile1   test1Nfile2   test2c                 ~  < SP                  \        V R ,          4      4      ;_uu_ 4       pVP                  4       R8X  g   Q h RRR4       SP                  \        V R,          4      4      ;_uu_ 4       pVP                  4       R8X  g   Q h RRR4       R#   + '       g   i     L\; i  + '       g   i     R# ; i)r  r  Nr  r  )r   r   r  )destination_dirrT  r   s   & r    check_copied_files5test_copy_files_directory.<locals>.check_copied_files  s    &&s?W+D'EFF!668x''' G&&s?W+D'EFF!668x''' GF GFFFFs   B5B+B(	+B<	destination1destination2)r  r  destination3destination4destination5Fr  )r   mkdirr   r   rR  r   r   )r   
source_dirrT  r  destination_dir1destination_dir2destination_dir3r  r  destination_dir4destination_dir5r   s   &          @r    test_copy_files_directoryr    s   G 8#J		#	#C
W(<$=	>	>!	 
?		#	#C
W(<$=	>	>!	 
?( /s:$4 56'( /s:$4 5!(J'( / Z1J%c*:&;<Oz+'( /z,'( /zuM'(U 
?	>	>	>	>	>s   G#G7#G4	7H	c                  X    R p \         P                  ! \        P                  RV .4       R# )a  if 1:
        import pytest
        from pyarrow.fs import (FileSystem, S3FileSystem,
                                ensure_s3_initialized, finalize_s3)

        fs, path = FileSystem.from_uri('s3://mf-nwp-models/README.txt')
        assert fs.region == 'eu-west-1'
        f = fs.open_input_stream(path)
        f.read(50)

        finalize_s3()

        with pytest.raises(ValueError, match="S3 .* finalized"):
            f.read(50)
        with pytest.raises(ValueError, match="S3 .* finalized"):
            fs.open_input_stream(path)
        with pytest.raises(ValueError, match="S3 .* finalized"):
            S3FileSystem(anonymous=True)
        with pytest.raises(ValueError, match="S3 .* finalized"):
            FileSystem.from_uri('s3://mf-nwp-models/README.txt')
        -cN
subprocess
check_callsys
executablecodes    r    test_s3_finalizer  >  s$    D* 3>>467r#   c                  X    R p \         P                  ! \        P                  RV .4       R# )a  if 1:
        import pytest
        from pyarrow.fs import resolve_s3_region, ensure_s3_initialized, finalize_s3

        resolve_s3_region('mf-nwp-models')

        finalize_s3()

        # Testing both cached and uncached accesses
        with pytest.raises(ValueError, match="S3 .* finalized"):
            resolve_s3_region('mf-nwp-models')
        with pytest.raises(ValueError, match="S3 .* finalized"):
            resolve_s3_region('arrow-datasets')
        r  Nr  r  s    r     test_s3_finalize_region_resolverr  Z  s$    D 3>>467r#   c                  X    R p \         P                  ! \        P                  RV .4       R# )a  if 1:
        import threading
        import pytest
        from pyarrow.fs import (FileSystem, S3FileSystem,
                                ensure_s3_initialized, finalize_s3)
        threads = []
        fn = lambda: FileSystem.from_uri('s3://mf-nwp-models/README.txt')
        for i in range(4):
            thread = threading.Thread(target = fn)
            threads.append(thread)
            thread.start()

        for thread in threads:
            thread.join()

        finalize_s3()
        r  Nr  r  s    r    test_concurrent_s3fs_initr  n  s$    
D" 3>>467r#   zUatexit(ensure_s3_finalized) will be called too late with bundled aws-sdk-cpp 1.11.587rA  z?Leaking S3ClientFinalizer causes segfault on musl based systemsc            	      ^    \         P                  ! R R.4       \        4       p R RRRV  2R\        P                  P                  \        R4      .p\         P                  ! V\         P                  R7      p R	V  R
2p\        P                  ! 4       pRp\        P                  ! 4       V^,           8  d3    \        V4      ;_uu_ 4       pVP                  ^8X  g   Q h RRR4       M\        P"                  ! RV: RV 24       VP%                  4        VP'                  4       ^8X  g   Q hR#   \         d    \        P                  ! R4        EL8i ; i  + '       g   i     L; i  \         d$   pTp\        P                   ! R4        Rp?K  Rp?ii ; i  TP%                  4        i ; i)uwsgiz	--versionz"uwsgi not installed on this Pythonz-iz--httpz
127.0.0.1:z--wsgi-filezwsgi_examples.py)stdinzhttp://127.0.0.1:z/s3/Ng?zCould not fetch r   )r  r  rR   r   r   r   r  r8   joinherePopenDEVNULLtimer   statusr   sleepfail	terminatewait)r   argsprocurl
start_timeerrorrespr   s           r    test_uwsgi_integrationr    sX   :w45 DT8z$%8277<<.@ACDD
(:(:;D!$t,YY[
iikJN* S\\T;;#--- "
 KK*3'E7;<99;"3  :89: "\   

3  	s_   D. 8>F 7E) 
EE) 'F .!EEE&	!E) )F4FF FF F,c                  n    ^ RI Hp  ^ RIHp \        P                  ! R4      w  r#\        \        X! 4       4      4      pW$8X  g   Q hVR8X  g   Q hRp\        P                  ! RV 24      w  r&\        \        X ! 4       4      4      pW$8X  g   Q hR#   \         d    \
        P                  ! R4        Li ; i)	r   )r   MemoryFileSystemfsspec not installedz$fsspec+memory://path/to/data.parquetz/path/to/data.parquetzfile:///tmp/my.filezfsspec+N)fsspec.implementations.localr   fsspec.implementations.memoryr  ImportErrorr   r   r   rm  r   r   )r   r  r   r8   expected_fsro  rS  s          r    test_fsspec_filesystem_from_urir    s    ,@B ""#IJHB}-=-?@AK****  C'#0EB}_->?@K  ,*+,s   B !B43B4c                  ~  a  ^ RI Hp  \        X ! 4       4      oSP                  RRR7       SP                  RRR7       SP                  R/ R7      ;_uu_ 4       pVP                  R	4       R
R
R
4       SP                  R/ R7      ;_uu_ 4       pVP                  R4       R
R
R
4       V3R lpV! R4      \        P                  8X  g   Q hV! R4      \        P                  8X  g   Q hV! R4      \        P                  8X  g   Q hSP                  4        V! R4      \        P                  8X  g   Q hV! R4      \        P                  8X  g   Q hV! R4      \        P                  8X  g   Q hR
#   \         d    \        P                  ! R4        ELi ; i  + '       g   i     EL4; i  + '       g   i     EL; i)r   r  r  test_dirTr  ztest_dir/subdirztest_file.txtr   s   test contentNztest_dir/nested_file.txts   nested contentc                 J   < SP                  V .4      ^ ,          P                  # )r   )rH   rZ  )r8   r   s   &r    get_type6test_fsspec_delete_root_dir_contents.<locals>.get_type  s!    '*///r#   )r  r  r  r   r   r   rZ   r   rR  r   rA   rB   rg   rC   )r  r  r  r   s      @r    $test_fsspec_delete_root_dir_contentsr    sw   ,B 
')	*B MM*M-MM#tM4					<	<_% 
= 
		9B		G	G6&' 
H0 O$555J8#5#5555./8==@@@ ! O$(9(9999J8#4#4444./83D3DDDD;  ,*+, 
=	<	< 
H	G	Gs)   E/ FF+/!FFF(	+F<	c                     \         P                  ! R 4        ^ RIHp  \        P                  ! R4      w  r\        \        X ! 4       4      4      pW8X  g   Q hVR8X  g   Q hR#   \         d    \         P
                  ! R4        Lgi ; i)r  )HfFileSystemzhuggingface_hub not installedzFhf://datasets/stanfordnlp/imdb/plain_text/train-00000-of-00001.parquetzAdatasets/stanfordnlp/imdb/plain_text/train-00000-of-00001.parquetN)
r   r  huggingface_hubr  r  r   r   rm  r   r   )r  r   r8   r  s       r    $test_huggingface_filesystem_from_urir!    s{    
!50 ""PHB }\^<=KVVVV  5345s   A" "!BB)r  r  r  )r  r  r  )r  r  r  r  )ro  r~  r  )r   r   r   r  r  r  urllib.requestr   r  r  r  r   r  r   r}   pyarrow.tests.test_ior   pyarrow.tests.utilr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   pyarrow.utilr   r8   dirnameabspathr  r  r   fixturer   r   r   r   r   r   r   r   r   rO  r  r  r  r  r"  r(  markr   r   r   r)  r   r   r   r   r9  r<  r>  rE  rH  rU  ra  rd  rl  rn  ru  rw  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  parametrizecompressr  r  r  
decompressr  r  r  r  r	  r  r  r&  r?  rK  rR  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  	processes	threadingr  r   skipifr  r  r  r!  r2   r#   r    <module>r0     sm	  $ 3 2  	  "  
     76 6$ $ $ $ ( 
wwrwwx01f'$ f'R              :  4   @  8  $      , 
LL LL+ LL1 LLkknn
 LLkkoo
 LLkk
 LLkk
 LL LL: LL: LLB LLE LL=kknnk: :v2w:v2 # # ' ' / / 5 5	2&
>
#
  5  5F:
O(K 6 6 e}% &(2"- 8+v5 p".@$.(
	(($ 0	tX	r8	t}}%	dmm$	
 
&&  2	tX	r8	t'	doo&		) 	) @	tXx(	r8X&	t}}doo6	dmmT__5	; ;0".#.( #B #BL e7 e7P J3 J3Z ' '. [ [| E1 E1P C or"_i0oy13!?NC$#&oz24!?OD/3*-*<=!F $!%$!" 
iX.5	5 + +$ + +&(
-*".,:3()' F F.  B ' ' 1# 1#h0)f 8 86 8 8& 8   8,  6 7(* 4T UU7 
@( EFWr#   