+
    xȇi                        R t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIH	t
 ]P                  P                  RRR..4      R 4       t]P                  P                  R/ RR	/R
R/.4      R 4       tR tR tR t]P                  P                  R. RO4      R 4       t]P                  P                  RRR.4      R 4       tR tR# )zf
Tests that comments are properly handled during parsing
for all of the parsers defined in parsers.py
)StringION)	DataFrame	na_valuesNaNc                    T pR p\        . R
OR\        P                  R... ROR7      pVP                  R8X  dO   Rp\        P
                  ! \        VR7      ;_uu_ 4        VP                  \        V4      RVR7       R	R	R	4       R	# VP                  \        V4      RVR7      p\        P                  ! Wd4       R	#   + '       g   i     R	# ; i)z&A,B,C
1,2.,4.#hello world
5.,NaN,10.0
      @      $@columnspyarrow?The 'comment' option is not supported with the 'pyarrow' enginematch#commentr   Ng      ?g       @      @ABCr   npnanenginepytestraises
ValueErrorread_csvr   tmassert_frame_equal)all_parsersr   parserdataexpectedmsgresults   &&     s/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/io/parser/test_comment.pytest_commentr)      s    FD 	3-.H }}	!O]]:S11OOHTNC9OM 2__Xd^SI_NF&+	 21    B==C	read_kwargslineterminator*sepz\s+c                    T pR pVP                  R4      '       d   VP                  RR4      pM8VP                  R4      '       d"   VP                  RVP                  R4      4      pRVR&   VP                  R8X  dX   RV9   d   R	pMR
p\        P                  ! \
        VR7      ;_uu_ 4        VP                  ! \        V4      3/ VB  RRR4       R# VP                  R8X  de   VP                  R4      '       dN   Rp\        P                  ! \
        VR7      ;_uu_ 4        VP                  ! \        V4      3/ VB  RRR4       R# VP                  ! \        V4      3/ VB p\        . ROR\        P                  R... ROR7      p\        P                  ! WV4       R#   + '       g   i     R# ; i  + '       g   i     R# ; i)z@# empty
A,B,C
1,2.,4.#hello world
#ignore this line
5.,NaN,10.0
r.   , r,   
r   r   r   zFThe 'lineterminator' option is not supported with the 'pyarrow' enginer   r   Npythonz>Custom line terminators not supported in python parser \(yet\)r   r   r	   r   r   )getreplacer   r   r   r   r   r   r   r   r   r    r!   )r"   r+   r#   r$   r&   r'   r%   s   &&     r(   test_line_commentr6   "   sa   FD u||C%	)	*	*||D+//2B"CD K	}}	!{*X  TC]]:S11OOHTN:k: 2	(	"{7G'H'HO]]:S11OOHTN:k: 2__Xd^;{;F	3-.H &+ 21 21s   -F!"F5!F2	5G	c                    T pR p\        . R
OR\        P                  R... ROR7      pVP                  R8X  dO   Rp\        P
                  ! \        VR7      ;_uu_ 4        VP                  \        V4      R^R7       R	R	R	4       R	# VP                  \        V4      R^R7      p\        P                  ! WS4       R	#   + '       g   i     R	# ; i)zH# empty
random line
# second empty line
1,2,3
A,B,C
1,2.,4.
5.,NaN,10.0
r   r   r	   r   r   r   r   )r   skiprowsNr   r   r   r"   r#   r$   r%   r&   r'   s   &     r(   test_comment_skiprowsr:   H   s    FD 	3-.H }}	!O]]:S11OOHTNC!OD 2__Xd^S1_EF&+ 21r*   c                    T pR p\        . R
OR\        P                  R... ROR7      pVP                  R8X  dO   Rp\        P
                  ! \        VR7      ;_uu_ 4        VP                  \        V4      R^R7       R	R	R	4       R	# VP                  \        V4      R^R7      p\        P                  ! WS4       R	#   + '       g   i     R	# ; i)z<# empty
# second empty line
1,2,3
A,B,C
1,2.,4.
5.,NaN,10.0
r   r   r	   r   r   r   r   r   headerNr   r   r   r9   s   &     r(   test_comment_headerr>   `   s    FD 	3-.H }}	!O]]:S11OOHTNCOB 2__Xd^S_CF&+	 21r*   c           	         T pR p\        . R
OR\        P                  R... ROR7      pVP                  R8X  dP   Rp\        P
                  ! \        VR7      ;_uu_ 4        VP                  \        V4      R^^R7       R	R	R	4       R	# VP                  \        V4      R^^R7      p\        P                  ! WS4       R	#   + '       g   i     R	# ; i)zU# empty
# second empty line
# third empty line
X,Y,Z
1,2,3
A,B,C
1,2.,4.
5.,NaN,10.0
r   r   r	   r   r   r   r   )r   r8   r=   Nr   r   r   r9   s   &     r(   test_comment_skiprows_headerr@   v   s    FD 	3-.H }}	!O]]:S11OOHTNC!AON 2__Xd^S1Q_OF&+ 21s    B??C	comment_charc           
         T pR pVP                   R8X  d^   Rp\        P                  ! \        VR7      ;_uu_ 4        VP	                  \        VP                  RV4      4      VR7       RRR4       R# VP	                  \        VP                  RV4      4      VR7      p\        . RO. R	O.. R
OR7      p\        P                  ! WV4       R#   + '       g   i     R# ; i)z,a,b,c
1,2,3#ignore this!
4,5,6#ignorethistoor   r   r   r   )r   Nr	            )         abc)
r   r   r   r   r   r   r5   r   r    r!   )r"   rA   r#   r$   r&   r'   r%   s   &&     r(   test_custom_comment_charrN      s    F;D}}	!O]]:S11OOc<89<   2 	__c<01<  F )Y/IH&+ 21 	s   -CC	r=   inferc           	         T pR pVf   \        ^ RR.^RR.^RR./4      pM\        . RO.. ROR7      pVP                  R	8X  dO   R
p\        P                  ! \        VR7      ;_uu_ 4        VP                  \        V4      RVR7       RRR4       R# VP                  \        V4      RVR7      p\        P                  ! Wd4       R#   + '       g   i     R# ; i)z # notes
a,b,c
# more notes
1,2,3NrK   1rL   2rM   3r	   r   r   r   r   r<   rC   rJ   )	r   r   r   r   r   r   r   r    r!   )r"   r=   r#   r$   r%   r&   r'   s   &&     r(   test_comment_first_linerT      s     F0D~a#sQc
ASzJKi[/B}}	!O]]:S11OOHTNCOG 2__Xd^S_HF&+	 21s   *CC	c                 v   V P                   R 8X  d7   RpVP                  \        P                  P	                  V\
        R7      4       T pRpVP                   R8X  dO   Rp\        P                  ! \        VR7      ;_uu_ 4        VP                  \        V4      RRR	7       R
R
R
4       R
# VP                  \        V4      RRR	7      p\        R. ROR. RORR\        P                  \        P                  .RR\        P                  R./4      p\        P                  ! Wg4       R
#   + '       g   i     R
# ; i)rM   z=see gh-34002: works on the python engine but not the c engine)reasonr   zU# this is a comment
col1,col2,col3,col4
1,2,3,4#inline comment
4,5#,6,10
7,8,#N/A,11
r   r   r   r   z#N/Ar   Ncol1col2col3g      @col4r   g      &@)rD   rG      )rE   rH      )r   applymarkerr   markxfailAssertionErrorr   r   r   r   r   r   r   r    r!   )r"   requestrV   r#   r$   r&   r'   r%   s   &&      r(   "test_comment_char_in_default_valuerb      s    S PFKK--VN-STF	 	 }}	!O]]:S11OOHTNC6OJ 2__Xd^SF_KFIIS"&&"&&)S"&&$'		
H &+ 21s   D''D8	)r   ~&^r-   @)__doc__ior   numpyr   r   pandasr   pandas._testing_testingr    r^   parametrizer)   r6   r:   r>   r@   rN   rT   rb        r(   <module>rp      s   
      teWo6, 7,$ .>-Dufo(VW", X",J,0,,,6 )GH, I,& GT?3, 4,&,ro   