+
    JV-j�3  ã                   óö  € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI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t^ RIt^ RItR t]P*                  R 4       tR tR tR tRR ltR	 tR
 t]P*                  R 4       t]P*                  R 4       t]P*                  R 4       tR t  ! R R4      t! ! R R]PD                  PF                  4      t$]P*                  RR/R l4       t%R t&R t'R t(R t)R t*R# )z
Utility functions for testing
N)Útagsc                 ó.   € \         P                  ! R4      # )z<Randomly choose either 1 or -1.

Returns
-------
sign : int
)éÿÿÿÿé   ©ÚrandomÚchoice© ó    Úc/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/pyarrow/tests/util.pyÚrandsignr   +   s   € ô �=Š=˜Ó!Ð!r
   c              #  óÐ   "  € \         P                  ! 4       p\         P                  ! V 4        Rx € \         P                  ! V4       R#   \         P                  ! T4       i ; i5i)zûSet the random seed inside of a context manager.

Parameters
----------
seed : int
    The seed to set

Notes
-----
This function is useful when you want to set a random seed but not affect
the random state of other functions using the random module.
N)r   ÚgetstateÚseedÚsetstate)r   Úoriginal_states   & r   Úrandom_seedr   5   s?   é € ô —_’_Ó&€NÜ
‡K‚K�Ôð(Ûä�Š˜Ö'øŒ�Š˜Õ'üs   ‚,A&¯A ³A&ÁA#Á#A&c                ó°  € ^T u;8:  d   ^&8:  g   Q R4       h Q R4       hV^ 8  d   \        R4      h^
W,
          ,          ^,
          p\        P                  ! V) V4      pV'       g   \        P                  ! V4      # ^
V,          ^,
          p\        P                  ! ^ V4      p\        P                  ! V R\        V4      P                  VR4       24      # )aÇ  Generate a random decimal value with specified precision and scale.

Parameters
----------
precision : int
    The maximum number of digits to generate. Must be an integer between 1
    and 38 inclusive.
scale : int
    The maximum number of digits following the decimal point.  Must be an
    integer greater than or equal to 0.

Returns
-------
decimal_value : decimal.Decimal
    A random decimal.Decimal object with the specified precision and scale.
z,precision must be between 1 and 38 inclusivezHranddecimal does not yet support generating decimals with negative scaleÚ.Ú0)Ú
ValueErrorr   ÚrandintÚdecimalÚDecimalÚstrÚrjust)Ú	precisionÚscaleÚmax_whole_valueÚwholeÚmax_fractional_valueÚ
fractionals   &&    r   Úranddecimalr"   K   sË   € ð" �	Ö˜RÔÐOÐ!OÓOÑÐOÐ!OÓOÐØˆq„yÜðó
ð 	
ð ˜YÕ.Õ/°!Õ3€OÜ�NŠN˜OÐ+¨_Ó=€EçÜ�Š˜uÓ%Ð%à �;¨�?ÐÜ—’ Ð#7Ó8€Jä�?Š?Øˆ'�”3�z“?×(Ñ(¨°Ó4Ð5Ð6óð r
   c           	      ó~   € \        \        V 4       Uu. uF  p\        P                  ! ^A^z4      NK  	  up4      # u upi )éA   )ÚbytesÚranger   r   )ÚlengthÚis   & r   Úrandom_asciir)   p   s.   € Ü´5¸´=ÓA±=¨a”&—.’.  SÖ)±=ÑAÓBÐBùÒAs   “ :c                ó¨   a€ \        \        P                  \        P                  ,           4      oRP	                  V3R l\        V 4       4       4      # )z
Generate one random string.
Ú c              3   óP   <"  € T F  p\         P                  ! S4      x € K  	  R # 5i©Nr   )Ú.0r(   ÚRANDS_CHARSs   & €r   Ú	<genexpr>Úrands.<locals>.<genexpr>y   s   øé € ÐE±}°!”6—=’= ×-Ð-³}ùs   ƒ#&)ÚlistÚstringÚascii_lettersÚdigitsÚjoinr&   )Úncharsr/   s   &@r   Úrandsr8   t   s7   ø€ ô ”v×+Ñ+¬f¯m©mÕ;Ó<€KØ�7‰7ÔE´u¸V´}ÓEÓEÐEr
   c                óÈ   aaaaa	a
€ ^ RI pVP                  4       o
VV
3R loS! 4       oVVV	V3R lp\        V4       F!  o	V ! 4        S	V,          ^ 8X  g   K  V! 4        K#  	  R# )a•  
Execute the function and try to detect a clear memory leak either internal
to Arrow or caused by a reference counting problem in the Python binding
implementation. Raises exception if a leak detected

Parameters
----------
f : callable
    Function to invoke on each iteration
metric : {'rss', 'vms', 'shared'}, default 'rss'
    Attribute of psutil.Process.memory_info to use for determining current
    memory use
threshold : int, default 128K
    Threshold in number of bytes to consider a leak
iterations : int, default 10
    Total number of invocations of f
check_interval : int, default 1
    Number of invocations of f in between each memory use check
Nc                  ób   <€ \         P                  ! 4        \        SP                  4       S 4      # r-   )ÚgcÚcollectÚgetattrÚmemory_info)ÚmetricÚprocs   €€r   Ú_get_useÚ#memory_leak_check.<locals>._get_use”   s"   ø€ Ü
�
Š
ŒÜ�t×'Ñ'Ó)¨6Ó2Ð2r
   c                  ód   <€ S! 4       p V S,
          S8”  d   \        R V S,
           RS R24      hR# )z.Memory leak detected. Departure from baseline z after z iterationsN)Ú	Exception)Úcurrent_userA   Úbaseline_user(   Ú	thresholds    €€€€r   Ú_leak_checkÚ&memory_leak_check.<locals>._leak_checkš   sE   ø€ Ù“jˆØ˜Õ%¨	Ô1ÜØ@Ø Õ-Ð.¨g°a°S¸ðEóð ñ 2r
   )ÚpsutilÚProcessr&   )Úfr?   rG   Ú
iterationsÚcheck_intervalrJ   rH   rA   rF   r(   r@   s   &ff&&  @@@@r   Úmemory_leak_checkrO   |   sT   ý€ ó* Ø�>‰>Ó€Dö3ñ “:€L÷ð ô �:ÖˆÙ	ŒØˆ~Õ Ö"ÙŽMó r
   c                  ó’  € \         P                  P                  4       p V P                  R R4      p\         P                  P                  \         P                  P                  \         P                  P                  \        P                  4      4      4      pV'       d"   \         P                  P                  W!34      pMTpW0R &   V # )Ú
PYTHONPATHr+   )ÚosÚenvironÚcopyÚgetÚpathÚabspathÚdirnameÚpaÚ__file__Úpathsepr6   )ÚenvÚexisting_pythonpathÚmodule_pathÚnew_pythonpaths       r   Ú get_modified_env_with_pythonpathr`   ¨   s‚   € ä
�*‰*�/‰/Ó
€CØŸ'™' ,°Ó3Ðä—'‘'—/‘/Ü
�‰�‰œŸ™Ÿ™¬¯©Ó4Ó5ó7€K÷ ÜŸ™Ÿ™¨+Ð)KÓL‰à$ˆØ&ˆÑØ€Jr
   c                 óL  € \        4       p\        P                  P                  \        P                  P	                  \
        4      4      p\        P                  P                  W04      p\        P                  V.pVP                  V4       \        P                  ! WRR 7       R# ))r\   N)r`   rR   rV   rX   ÚrealpathrZ   r6   ÚsysÚ
executableÚextendÚ
subprocessÚ
check_call)Úscript_nameÚargsÚsubprocess_envÚdir_pathÚpython_fileÚcmds   &*    r   Úinvoke_scriptrn   ¸   se   € Ü5Ó7€Nä�w‰w�‰œrŸw™w×/Ñ/´Ó9Ó:€HÜ—'‘'—,‘,˜xÓ5€Kä�>‰>˜;Ð
'€CØ‡J�JˆtÔä×Ò˜#×2r
   c              #  ó,  "  € \         P                  P                  V 4      pV\         P                  V &    Rx € Vf   \         P                  V  R# V\         P                  V &   R#   Tf   \         P                  T  i T\         P                  T &   i ; i5i)z9
Temporarily set environment variable *name* to *value*.
N)rR   rS   rU   )ÚnameÚvalueÚ
orig_values   && r   Úchanged_environrs   Ä   sr   é € ô
 —‘—‘ Ó%€JØ„B‡J�JˆtÑð*ÛàÒÜ—
‘
˜4Ò à)ŒB�J‰J�tÓøð ÒÜ—
‘
˜4Ñ à)ŒB�J‰J�tÒüs   ‚3B¶A& º,BÁ&+BÂBc              #   óâ   "  € \         P                  ! 4       p\         P                  ! \        V 4      4        R x € \         P                  ! V4       R #   \         P                  ! T4       i ; i5ir-   )rR   ÚgetcwdÚchdirr   )rV   Úcurdirs   & r   Ú
change_cwdrx   Ô   s@   é € ä�YŠY‹[€FÜ‡H‚HŒS�‹YÔðÛä
�Š�ÖøŒ�Š�Õüs   ‚5A/¸A ¼A/ÁA,Á,A/c               #   ó    "  € \         P                  ! 4         R x € \         P                  ! 4        R #   \         P                  ! 4        i ; i5ir-   )r;   ÚdisableÚenabler	   r
   r   Údisabled_gcr|   Þ   s(   é € ä‡J‚J„LðÛä
�	Š	ŽøŒ�	Š	�üs   ‚A™4 �A´AÁAc                 óH   € \         P                  R 8X  d   RV  2pV# RV  2pV# )Úntzfile:///zfile://)rR   rp   )rV   Úuris   & r   Ú_filesystem_urir€   ç   s3   € ä	‡w�w�$„Ø˜˜Ðˆð €Jð ˜�vÐˆØ€Jr
   c                   ó,   a € ] tR t^ðt o R tR tRtV tR# )ÚFSProtocolClassc                ó   € Wn         R # r-   ©Ú_path©ÚselfrV   s   &&r   Ú__init__ÚFSProtocolClass.__init__ñ   s   € ØŽ
r
   c                ó,   € \        V P                  4      # r-   )r   r…   ©r‡   s   &r   Ú
__fspath__ÚFSProtocolClass.__fspath__ô   s   € Ü�4—:‘:‹Ðr
   r„   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__rˆ   rŒ   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r‚   r‚   ð   s   ø‡ € ò÷ð r
   r‚   c                   ó�   a € ] tR t^øt o 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R tRtV tR# )ÚProxyHandlerz„
A dataset handler that proxies to an underlying filesystem.  Useful
to partially wrap an existing filesystem with partial changes.
c                ó   € Wn         R # r-   ©Ú_fs)r‡   Úfss   &&r   rˆ   ÚProxyHandler.__init__þ   s   € ØŽr
   c                ól   € \        V\        4      '       d   V P                  VP                  8H  # \        # r-   ©Ú
isinstancer—   rš   ÚNotImplemented©r‡   Úothers   &&r   Ú__eq__ÚProxyHandler.__eq__  ó(   € Ü�eœ\×*Ò*Ø—8‘8˜uŸy™yÑ(Ð(ÜÐr
   c                ól   € \        V\        4      '       d   V P                  VP                  8g  # \        # r-   rž   r¡   s   &&r   Ú__ne__ÚProxyHandler.__ne__  r¥   r
   c                ó<   € R V P                   P                  ,           # )zproxy::)rš   Ú	type_namer‹   s   &r   Úget_type_nameÚProxyHandler.get_type_name  s   € Ø˜4Ÿ8™8×-Ñ-Õ-Ð-r
   c                ó8   € V P                   P                  V4      # r-   )rš   Únormalize_pathr†   s   &&r   r®   ÚProxyHandler.normalize_path  s   € Ø�x‰x×&Ñ& tÓ,Ð,r
   c                ó8   € V P                   P                  V4      # r-   ©rš   Úget_file_info)r‡   Úpathss   &&r   r²   ÚProxyHandler.get_file_info  s   € Ø�x‰x×%Ñ% eÓ,Ð,r
   c                ó8   € V P                   P                  V4      # r-   r±   )r‡   Úselectors   &&r   Úget_file_info_selectorÚ#ProxyHandler.get_file_info_selector  s   € Ø�x‰x×%Ñ% hÓ/Ð/r
   c                ó:   € V P                   P                  WR 7      # ))Ú	recursive)rš   Ú
create_dir)r‡   rV   rº   s   &&&r   r»   ÚProxyHandler.create_dir  s   € Ø�x‰x×"Ñ" 4Ð"Ó=Ð=r
   c                ó8   € V P                   P                  V4      # r-   )rš   Ú
delete_dirr†   s   &&r   r¾   ÚProxyHandler.delete_dir  s   € Ø�x‰x×"Ñ" 4Ó(Ð(r
   c                ó<   € V P                   P                  VVR 7      # ))Úmissing_dir_ok©rš   Údelete_dir_contents)r‡   rV   rÁ   s   &&&r   rÃ   Ú ProxyHandler.delete_dir_contents  s%   € Ø�x‰x×+Ñ+¨DØ;Ið ,ó Kð 	Kr
   c                ó<   € V P                   P                  R RR7      # )r+   T)Úaccept_root_dirrÂ   r‹   s   &r   Údelete_root_dir_contentsÚ%ProxyHandler.delete_root_dir_contents!  s   € Ø�x‰x×+Ñ+¨BÀÐ+ÓEÐEr
   c                ó8   € V P                   P                  V4      # r-   )rš   Údelete_filer†   s   &&r   rÊ   ÚProxyHandler.delete_file$  s   € Ø�x‰x×#Ñ# DÓ)Ð)r
   c                ó8   € V P                   P                  W4      # r-   )rš   Úmove©r‡   ÚsrcÚdests   &&&r   rÍ   ÚProxyHandler.move'  s   € Ø�x‰x�}‰}˜SÓ'Ð'r
   c                ó8   € V P                   P                  W4      # r-   )rš   Ú	copy_filerÎ   s   &&&r   rÓ   ÚProxyHandler.copy_file*  s   € Ø�x‰x×!Ñ! #Ó,Ð,r
   c                ó8   € V P                   P                  V4      # r-   )rš   Úopen_input_streamr†   s   &&r   rÖ   ÚProxyHandler.open_input_stream-  s   € Ø�x‰x×)Ñ)¨$Ó/Ð/r
   c                ó8   € V P                   P                  V4      # r-   )rš   Úopen_input_filer†   s   &&r   rÙ   ÚProxyHandler.open_input_file0  s   € Ø�x‰x×'Ñ'¨Ó-Ð-r
   c                ó:   € V P                   P                  WR 7      # ©)Úmetadata)rš   Úopen_output_stream©r‡   rV   rÝ   s   &&&r   rÞ   ÚProxyHandler.open_output_stream3  ó   € Ø�x‰x×*Ñ*¨4Ð*ÓCÐCr
   c                ó:   € V P                   P                  WR 7      # rÜ   )rš   Úopen_append_streamrß   s   &&&r   rã   ÚProxyHandler.open_append_stream6  rá   r
   r™   N)rŽ   r�   r�   r‘   Ú__doc__rˆ   r£   r§   r«   r®   r²   r·   r»   r¾   rÃ   rÇ   rÊ   rÍ   rÓ   rÖ   rÙ   rÞ   rã   r’   r“   r”   s   @r   r—   r—   ø   sn   ø‡ € ñò
òò
ò
.ò-ò-ò0ò>ò)òKòFò*ò(ò-ò0ò.òD÷Dð Dr
   r—   Úwarn_on_full_bufferFc              #   óÌ  "  € \         P                  ! 4       w  rR p VP                  R4       VP                  R4       \        P                  ! VP                  4       V R7      pVx € Ve   \        P                  ! V4       VP                  4        VP                  4        R #   Te   \        P                  ! T4       TP                  4        TP                  4        i ; i5i)NF)ræ   )ÚsocketÚ
socketpairÚsetblockingÚsignalÚset_wakeup_fdÚfilenoÚclose)ræ   ÚrÚwÚold_fds   $   r   Úsignal_wakeup_fdrò   :  sª   é € ô ×ÒÓ�D€AØ€Fð
Ø	�‰�eÔØ	�‰�eÔÜ×%Ò%Ø�H‰H‹JÐ,?ôAˆàŠàÒÜ× Ò  Ô(Ø	�‰Œ	Ø	�‰Ž	øð ÒÜ× Ò  Ô(Ø	�‰Œ	Ø	�‰�	üs   ‚C$�AB% Á)<C$Â%<C!Ã!C$c                 óÜ  € V R .p\         P                  ! V\         P                  \         P                  RR7      ;_uu_ 4       pVP                  ^
4      ^ 8w  d    RRR4       R# VP                  P                  4       pV R,           p\        P                  ! WT4      pV'       d*   VP                  ^4      p\        V4      V8¬  uuRRR4       # \        R4      h  + '       g   i     R# ; i)z	--versionúutf-8©ÚstdoutÚstderrÚencodingNFz version RELEASE\.(\d+)-.*z+minio component older than the minimum year)rf   ÚPopenÚPIPEÚwaitrö   ÚreadÚreÚsearchÚgroupÚintÚFileNotFoundError)Ú	componentÚminimum_yearÚ	full_argsr@   rö   ÚpatternÚversion_matchÚversion_years   &&      r   Ú_ensure_minio_component_versionr  M  sÒ   € Ø˜KÐ(€IÜ	×	Ò	˜)¬J¯O©OÜ!+§¡¸7÷
Dõ 
DØGKØ�9‰9�R‹=˜AÔØ÷
Dñ 
Dð —‘×!Ñ!Ó#ˆØÐ;Õ;ˆÜŸ	š	 'Ó2ˆßØ(×.Ñ.¨qÓ1ˆLÜ�|Ó$¨Ñ4÷
Dò 
Dô $Ø=ó?ð ?÷
D÷ 
Dð 
Dús   ÁCÁ%ACÃCÃC+	c           	      ó   € \         P                   ! 4       p\         P                   ! 4       V,
          ^
8  d    \        V RRRRV 2W#4       R# \	        R4      h  \         d    \         P                  ! ^4        Kf  i ; i)é
   ÚaliasÚsetÚmyminiozhttp://Nz+mc command could not connect to local minio)ÚtimeÚ_run_mc_commandÚChildProcessErrorÚsleeprD   )ÚmcdirÚaddressÚ
access_keyÚ
secret_keyÚstarts   &&&& r   Ú_wait_for_minio_startupr  ^  so   € Ü�IŠI‹K€EÜ
�)Š)‹+˜Õ
 Ô
"ð	Ü˜E 7¨E°9Ø% g YÐ/°ôIáô ÐAÓ
BÐBøô !ô 	Ü�JŠJ�q�Mð	ús   ¸A Á!A=Á<A=c                 ó   € R RV .\        V4      ,           p\        P                  ! V\        P                  \        P                  RR7      ;_uu_ 4       pVP	                  ^
4      pRP                  V4      p\        RV 24       \        RV 24       \        RVP                  P                  4        24       \        RVP                  P                  4        24       V^ 8w  d   \        R	4      h R
R
R
4       R
#   + '       g   i     R
# ; i)Úmcz-Crô   rõ   Ú zCmd: z
  Return: z
  Stdout: z
  Stderr: zCould not run mcN)r2   rf   rù   rú   rû   r6   Úprintrö   rü   r÷   r  )r  ri   r  r@   ÚretvalÚcmd_strs   &*    r   r  r  j  sä   € Ø�t˜UÐ#¤d¨4£jÕ0€IÜ	×	Ò	˜)¬J¯O©OÜ!+§¡¸7÷
Dõ 
DØGKØ—‘˜2“ˆØ—(‘(˜9Ó%ˆÜ��g�YÐÔ Ü�
˜6˜(Ð#Ô$Ü�
˜4Ÿ;™;×+Ñ+Ó-Ð.Ð/Ô0Ü�
˜4Ÿ;™;×+Ñ+Ó-Ð.Ð/Ô0Ø�QŒ;Ü#Ð$6Ó7Ð7ð ÷
D÷ 
D÷ 
Dò 
Dús   ÁBC<Ã<D	c           
     ór  € \         P                  R8X  d   \        P                  ! R4        \	        RR4       \	        RR4       V R,          pV R,          w  rVrxV RV 2p	\
        P                  P                  VR4      p
\
        P                  P                  V
4      '       d   \        P                  ! V
4       \
        P                  ! V
4       \
        P                  P                  VR	4      p\        VR
R7      ;_uu_ 4       pVP                  V4       RRR4       \        W©Wx4       \        V
RRRRW#4       \        V
RRRRRV4       \        V
RRRRRRV4       \        V
RRR4       \        V
RRR4       R#   + '       g   i     Lm; i  \          d    \        P                  ! R4        R# i ; i)aF  
Attempts to use the mc command to configure the minio server
with a special user limited:limited123 which does not have
permission to create buckets.  This mirrors some real life S3
configurations where users are given strict permissions.

Arrow S3 operations should still work in such a configuration
(e.g. see ARROW-13685)
Úwin32z*The mc command is not installed on Windowsr  iå  ÚminioÚtempdirÚ
connectionÚ:zlimited-buckets-policy.jsonrð   )ÚmodeNÚadminÚuserÚaddzmyminio/ÚpolicyÚcreatezno-create-bucketsÚattachz--userÚmbzmyminio/existing-bucketz--ignore-existingzmyminio/no-delete-bucketz"Configuring limited s3 user failed)rc   ÚplatformÚpytestÚskipr  rR   rV   r6   ÚexistsÚshutilÚrmtreeÚmkdirÚopenÚwriter  r  r  )Ú	s3_serverr(  ÚusernameÚpasswordr!  ÚhostÚportr  r  r  r  Úpolicy_pathÚpolicy_files   &&&&         r   Ú_configure_s3_limited_userr<  x  sy  € ô ‡|�|�wÔô 	�ŠÐ@ÔAð":ä'¨¨dÔ3Ü'¨°Ô6à˜IÕ&ˆØ-6°|Õ-DÑ*ˆ�JØ�F˜!˜D˜6Ð"ˆä—‘—‘˜W dÓ+ˆÜ�7‰7�>‰>˜%× Ò Ü�MŠM˜%Ô Ü
�Š�ŒÜ—g‘g—l‘l 7Ð,IÓJˆÜ�+ C×(Õ(¨KØ×Ñ˜fÔ%÷ )ô 	  °
ÔGä˜˜w¨°Ø" Hô	8ä˜˜w¨°(Ø"Ð$7¸ô	Fä˜˜w¨°(Ø"Ð$7¸À8ô	Mô 	˜˜tÐ%>Ø+ô	-ô 	˜˜tÐ%?Ø+ö	-÷! )×(ûô& ô :Ü�ŠÐ8×9ð:ús+   ­CF ÄE>ÄA#F Å>F	Æ	F Æ!F6Æ5F6c                 ór   € \         P                  ! 4        F  p V P                  R4      '       g   K   R# 	  R# )z5
Checks whether it's running on musl systems or not.
Ú	musllinuxTF)r   Úplatform_tagsÚ
startswith)Úplatform_tags    r   Úrunning_on_musllinuxrB  ®  s0   € ô ×*Ò*Ö,ˆØ×"Ñ" ;×/Ô/Úñ -ñ r
   )Úrssi   r
  r   )+rå   Ú
contextlibr   r;   rR   r   rý   r0  rë   rè   r3   rf   rc   r  Ú	packagingr   r-  ÚpyarrowrY   Ú
pyarrow.fsr   Úcontextmanagerr   r"   r)   r8   rO   r`   rn   rs   rx   r|   r€   r‚   r›   ÚFileSystemHandlerr—   rò   r  r  r  r<  rB  r	   r
   r   Ú<module>rJ     s2  ðñ$ó Û Û 	Û 	Û Û 	Û Û Û Û Û Û 
Û Ý ã ã Û ò"ð ×Ññ(ó ð(ò*"òJCòFô)òXò 	3ð ×Ññ*ó ð*ð ×Ññó ðð ×Ññó ðò÷ñ ô?D�7—:‘:×/Ñ/ô ?DðD ×Ñð¨Eó ó ðò$?ò"	Cò8ò3:ôlr
   