
    Mh"                       S SK Jr  S SKrS SKrS SKJr  S SKJrJr  S SK	J
r   " S S5      r " S S\5      r " S	 S
\5      r " S S\5      r " S S\5      r " S S\5      r\R$                  S 5       r\R$                  S 5       r\r\r\r\r\/r\\/r\R6                  " \\R8                  R:                  S9/r/ \Q\Q\QrS/r SS/r!S/r"/ \!Q\ Q\"Qr#\R$                  " \\#S9S 5       r$\R$                  " \\!S9S 5       r%\R$                  " \\ S9S 5       r&\R$                  " \\"S9S 5       r'S r(\R$                  " \(" 5       S   \(" 5       S   S9S  5       r)/ S!Qr*/ S"Qr+S#S$/r,\+ V Vs/ s H  n \,  H	  o U  S%3PM     M     snn r-\R$                  " \*S&9S' 5       r.\R$                  " \-S&9S( 5       r/\R$                  " / S)QS&9S* 5       r0\R$                  S+ 5       r1\R$                  S, 5       r2gs  snn f )-    )annotationsN)VERSIONS)read_csv
read_tablec                  ~    \ rS rSr% SrS\S'   Sr/ rS\S'   S rS	 r	SSS
.     SS jjr
S rSS.   SS jjrSrg)
BaseParser   Nz
str | NoneengineTzlist[str | None]float_precision_choicesc                v    UR                  5       nUR                  U R                  U R                  S.5        U$ )N)r
   
low_memory)copyupdater
   r   )selfkwargss     Q/var/www/html/env/lib/python3.13/site-packages/pandas/tests/io/parser/conftest.pyupdate_kwargsBaseParser.update_kwargs   s+    DOOLM    c                :    U R                  U5      n[        U0 UD6$ N)r   r   r   argsr   s      r   r   BaseParser.read_csv   s"    ##F+(((r   )raise_on_extra_warningscheck_stacklevelc                   U R                  U5      n[        R                  " UUUUS9   [        U0 UD6sS S S 5        $ ! , (       d  f       g = f)N)matchr   r   )r   tmassert_produces_warningr   )r   	warn_typewarn_msgr   r   r   r   s          r   read_csv_check_warnings"BaseParser.read_csv_check_warnings   sM     ##F+''$;-	
 T,V,
 
 
s	   >
Ac                :    U R                  U5      n[        U0 UD6$ r   )r   r   r   s      r   r   BaseParser.read_table4   s"    ##F+4*6**r   )r   c                   U R                  U5      n[        R                  " XUS9   [        U0 UD6sS S S 5        $ ! , (       d  f       g = f)N)r   r   )r   r   r    r   )r   r!   r"   r   r   r   s         r   read_table_check_warnings$BaseParser.read_table_check_warnings8   sG     ##F+''?V
 t.v.
 
 
s	   <
A
 )r!   type[Warning]r"   strr   bool)r!   r+   r"   r,   )__name__
__module____qualname____firstlineno__r
   __annotations__r   r   r   r   r#   r   r(   __static_attributes__r*   r   r   r   r      sv    FJJ02-2) !%!%- - - -*+ !%/ / / /r   r   c                       \ rS rSrSr/ SQrSrg)CParserJ   c)Nhigh
round_tripr*   Nr.   r/   r0   r1   r
   r   r3   r*   r   r   r5   r5   J   s    F:r   r5   c                      \ rS rSrSrSrg)CParserHighMemoryO   Fr*   Nr.   r/   r0   r1   r   r3   r*   r   r   r<   r<   O   s    Jr   r<   c                      \ rS rSrSrSrg)CParserLowMemoryS   Tr*   Nr>   r*   r   r   r@   r@   S   s    Jr   r@   c                      \ rS rSrSrS/rSrg)PythonParserW   pythonNr*   r:   r*   r   r   rC   rC   W   s    F#fr   rC   c                      \ rS rSrSrS/rSrg)PyArrowParser\   pyarrowNr*   r:   r*   r   r   rG   rG   \   s    F#fr   rG   c                    U " SSS5      $ )z?
The directory path to the data files needed for parser tests.
ioparserdatar*   datapaths    r   csv_dir_pathrP   a   s    
 D(F++r   c                R    [         R                  R                  U " SSS5      S5      $ )z@
The path to the data file "test1.csv" needed for parser tests.
rK   rM   csvz	test1.csv)ospathjoinrN   s    r   csv1rV   i   s"    
 77<<vu5{CCr   marksrE   c_highc_lowrI   paramsidsc                    U R                  5       nUR                  S:X  a3  [        R                  " S[        S   5        SSKnUR                  S5        U$ )z!
Fixture all of the CSV parsers.
rI   r   N   )paramr
   pytestimportorskipr   rI   set_cpu_count)requestrL   rI   s      r   all_parsersre      sH    
 ]]_F}}	!Ix	':; 	a Mr   c                "    U R                  5       $ )z4
Fixture all of the CSV parsers using the C engine.
r`   rd   s    r   c_parser_onlyri          
 ==?r   c                "    U R                  5       $ )z9
Fixture all of the CSV parsers using the Python engine.
rg   rh   s    r   python_parser_onlyrl      rj   r   c                "    U R                  5       $ )z:
Fixture all of the CSV parsers using the Pyarrow engine.
rg   rh   s    r   pyarrow_parser_onlyrn      rj   r   c                    / n / n[        [        [        5       H  u  p#[        US5      (       a  UR                  S   nUR
                   Hr  nUR                  S:X  a  [        R                  R                  OSn[        R                  " U" 5       U4US9nU R                  U5        UR                  U SU 35        Mt     M     XS.$ )zU
Return all allowable parser and float precision
combinations and corresponding ids.
valuesr   rI   r*   rW   -r[   )zip_all_parsers_all_parser_idshasattrrp   r   r
   ra   mark
single_cpur`   append)r\   r]   rL   	parser_id	precisionrv   r`   s          r   ,_get_all_parser_float_precision_combinationsr{      s    
 F
C ?68$$]]1%F77I-3]]i-G6;;))RDLL&(I!6dCEMM% JJ)Ai[12 8	 @ ))r   r\   r]   c                    U R                   $ )zF
Fixture for all allowable combinations of parser
and float precision
rg   rh   s    r   all_parsers_all_precisionsr}      s     ==r   )   r	       ) rq   _utfUTFz{0})r\   c                    U R                   $ )z=
Fixture for all possible integer values for a UTF encoding.
rg   rh   s    r   	utf_valuer          
 ==r   c                    U R                   $ )z<
Fixture for all possible string formats of a UTF encoding.
rg   rh   s    r   encoding_fmtr      r   r   )*)z-1,0      )z-1,2e0g333333)z-1e0r   )z+1e0      ?)z+1e+0r   )z+1e-1皙?)z+,1e1r   )z+1,e0r   )z-,1e1r   )z-1,e0r   )z0,1r   )z1,r   )z,1r   )z-,1g)z1_,r   )z1_234,56
ףp=J@)z
1_234,56e0r   )r   r   )-_r   )-_1r   )-_1e0r   )_1r   )_1,r   )_1,_r   )_1e0r   )1,2e_1r   )1,2e1_0r   )1,_2r   ),1__2r   ),1er   )-,1er   )1_000,000_000r   )1,e1_2r   )e11,2r   )1e11,2r   )1,2,2r   )1,2_1r   )	1,2e-10e1r   )--1,2r   )1a_2,1r   )z1,2E-1gQ?)z1,2E1g      (@c                    U R                   $ )z
Fixture for all numeric formats which should get recognized. The first entry
represents the value to read while the second represents the expected result.
rg   rh   s    r   numeric_decimalr      s    h ==r   c                   SU R                   ;   a  U R                  S5      nO&SU R                   ;   a  U R                  S5      S   nOgUR                  S:X  a/  [        R                  R                  SS9nU R                  U5        gg)z}
Fixture that xfails a test if the engine is pyarrow.

Use if failure is do to unsupported keywords or inconsistent results.
re   r}   r   NrI   zpyarrow doesn't support this.reason)fixturenamesgetfixturevaluer
   ra   rv   xfailapplymarker)rd   rL   rv   s      r   pyarrow_xfailr     s     ,,,((7	%)=)=	=(()EFqI}}	!{{  (G HD! "r   c                    SU R                   ;   a  U R                  S5      nO&SU R                   ;   a  U R                  S5      S   nOgUR                  S:X  a  [        R                  " SS9  gg)zw
Fixture that skips a test if the engine is pyarrow.

Use if failure is do a parsing failure from pyarrow.csv.read_csv
re   r}   r   NrI   z,https://github.com/apache/arrow/issues/38676r   )r   r   r
   ra   skip)rd   rL   s     r   pyarrow_skipr   0  sg     ,,,((7	%)=)=	=(()EFqI}}	!IJ "r   )3
__future__r   rS   ra   pandas.compat._optionalr   pandasr   r   pandas._testing_testingr   r   r5   r<   r@   rC   rG   fixturerP   rV   _cParserHighMemory_cParserLowMemory_pythonParser_pyarrowParser_py_parsers_only_c_parsers_onlyr`   rv   rw   _pyarrow_parsers_onlyrs   _py_parser_ids_c_parser_ids_pyarrow_parsers_idsrt   re   ri   rl   rn   r{   r}   _utf_values_encoding_seps_encoding_prefixes_encoding_fmtsr   r   r   r   r   )sepprefixs   00r   <module>r      s   " 	  , 7/ 7/t;j ;
 w %: %
%J %
 , , D D ' $ !? %'89nFKK<R<RST LL#3L6KL7#!{ JMJNJ5IJ |9 : M: ; '^< = ,2FG H** 79(C46u=	 U^  &4%3cBThse5BT^
 {# $ ~& ' ,.^_.^ " "$ K KAs   .G5