+
    xȇi                     P   R t ^ RIHt ^ RIHt ^ RIHt ^ RIt^ RI	t	^ RI
t^ RI
Ht ^ RIHt ^ RIHt ]	P$                  P'                  R4      t]	P$                  P*                  ]	P$                  P,                  .t]	P$                  P1                  R4      R	 4       tR
 t]R 4       tR# )zd
Tests multithreading behaviour for reading and
parsing files for each parser defined in parsers.py
)	ExitStack)BytesIO)
ThreadPoolN)	DataFrame)Versionpyarrow_xfailz0ignore:Passing a BlockManager:DeprecationWarningc           
        a T pVP                   R 8X  di   \        P                  ! R 4      p\        VP                  4      \        R4      8  d0   VP                  \        P                  P                  RR7      4       ^do^
pV3R l\        V4       4       p\        4       ;_uu_ 4       pV Uu. uF  qvP                  \        V4      4      NK  	  ppVP                  \        ^4      4      p	V	P                  VP                  V4      p
V
^ ,          pV
 F  p\        P                   ! W4       K  	  RRR4       R# u upi   + '       g   i     R# ; i)pyarrowz16.0z+# ValueError: Found non-unique column index)reasonc              3      <"   T FG  pR P                  \        S4       Uu. uF  q"R RVR RVR 2NK  	  up4      P                  4       x  KI  	  R# u upi 5i)
d,N)joinrangeencode).0_imax_row_ranges   &  x/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/io/parser/test_multi_thread.py	<genexpr>7test_multi_thread_string_io_read_csv.<locals>.<genexpr>)   s^      !A 			}1EF1EAU!Aa5!A'1EFGNNPP! Gs   AA
"AN)enginepytestimportorskipr   __version__applymarkermarkxfailr   r   enter_contextr   r   mapread_csvtmassert_frame_equal)all_parsersrequestparserpa	num_filesbytes_to_dfstackbfilespoolresultsfirst_resultresultr   s   &&           @r   $test_multi_thread_string_io_read_csvr2      s    F}}	!  +2>>"WV_4!!)V!W MIy!K 
:EF+Q$$WQZ0+F"":a=1((6??E2qzF!!,7  
F 
s   (D>-"D9A D>9D>>E	c                  a a V V3R lp\        V4       Uu. uF  qRV,          V,          W#,          3NK  	  pp\        VR7      ;_uu_ 4       pVP                  WF4      pRRR4       X^ ,          P                  p	VR,           F	  p
Wn        K  	  \        P
                  ! V4      pV# u upi   + '       g   i     LV; i)a^  
Generate a DataFrame via multi-thread.

Parameters
----------
parser : BaseParser
    The parser object to use for reading the data.
path : str
    The location of the CSV file to read.
num_rows : int
    The number of rows to read per task.
num_tasks : int
    The number of tasks to use for reading this DataFrame.

Returns
-------
df : DataFrame
c           	        < V w  rV'       g   SP                  S^ ^ VR.R7      # SP                  S^ R\        V4      ^,           V^	.R7      # )a  
Create a reader for part of the CSV.

Parameters
----------
arg : tuple
    A tuple of the following:

    * start : int
        The starting row to start for parsing CSV
    * nrows : int
        The number of rows to read.

Returns
-------
df : DataFrame
date)	index_colheadernrowsparse_datesN)r6   r7   skiprowsr8   r9   )r"   int)argstartr8   r'   paths   &  r   reader0_generate_multi_thread_dataframe.<locals>.readerO   sf    $ ??!5vh #   Z!^  
 	
    )	processesN:   NN)r   r   r!   columnspdconcat)r'   r>   num_rows	num_tasksr?   r   tasksr.   r/   r7   rfinal_dataframes   ff&&        r    _generate_multi_thread_dataframerL   ;   s    ( 
F EJ)DTDTqA	"H$9:DT 
  
i	(	(D((6) 
) QZFR[[	  ii(O 
)	(s    B(B--B=	c                 T   ^p^0pTpRp\        R\        P                  P                  ^4      P                  V4      R\        P                  P                  ^4      P                  V4      R\        P                  P                  ^4      P                  V4      R\        P                  P                  ^4      P                  V4      R\        P                  P                  ^4      P                  V4      RR.V,          RR.V,          R	R	.V,          R
\        P
                  ! RVRR7      R\        P                  ! VRR7      /
4      pW,          pVP                  V4       \        WGW24      pVR,          p	V	R
,          P                  R4      V	R
&   \        P                  ! W4       R# )   z__thread_pool_reader__.csvar,   cr   efoobarbazr5   z20000101 09:00:00s)periodsfreqr;   int64)dtype:NNNzM8[us]N)r   nprandomdefault_rngrE   
date_rangearangeto_csvrL   astyper#   r$   )
tmp_pathr%   rH   rG   r'   	file_namedfr>   r1   expecteds
   &&        r   )test_multi_thread_path_multipart_read_csvre      s[    IHF,I	&&q)00:&&q)00:&&q)00:&&q)00:&&q)00:E7X%E7X%E7X%BMM"5xcR299XW5	

B DIIdO-fHPF!uH'..x8HV&+rA   )__doc__
contextlibr   ior   multiprocessing.poolr   numpyrZ   r   pandasrE   r   pandas._testing_testingr#   pandas.util.versionr   r   usefixturesxfail_pyarrow
single_cpuslow
pytestmarkfilterwarningsr2   rL   re    rA   r   <module>rv      s   
 !  +      '''8
 KK
KK
 NO8 P8<CL , ,rA   