
    hv                         d Z ddlmZ ddlZddlmZmZ ddlmZ	 ej                  j                  d      Zd Zd Zd Zej                  j!                  d	d
dddd
iddig      d        Zd Zy)zy
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
    )StringION)	DataFrameconcatz=ignore:Passing a BlockManager to DataFrame:DeprecationWarningc                    d}| }ddi} |j                   t        |      fi |}|j                  dk(  rEd}t        j                  t
        |      5   |j                   t        |      fddi| d d d        y  |j                   t        |      fddi|5 }|j                  d	      }t        j                  ||d d	        |j                  d
      }d d d        t        j                  |d	d         y # 1 sw Y   y xY w# 1 sw Y   /xY w)Nziindex,A,B,C,D
foo,2,3,4,5
bar,7,8,9,10
baz,12,13,14,15
qux,12,13,14,15
foo2,12,13,14,15
bar2,12,13,14,15
	index_colr   pyarrow@The 'iterator' option is not supported with the 'pyarrow' enginematchiteratorT      )	read_csvr   enginepytestraises
ValueErrorreadtmassert_frame_equal)	all_parsersdataparserkwargsexpectedmsgreaderfirst_chunk
last_chunks	            PD:\jyotish\venv\Lib\site-packages\pandas/tests/io/parser/common/test_iterator.pytest_iteratorr!      s    D F1Fvx~88H}}	!P]]:S1FOOHTNDTDVD 2	$	A$	A&	AVkk!n
k8BQ<8[[^
	 
B
 *hqrl3 2	A	As   C5<D5C>D
c                    | }d}|j                   dk(  rCd}t        j                  t        |      5  |j	                  t        |      d       d d d        y |j	                  t        |      d      5 }t        |      }d d d        t        g dg dg d	gg d
g d      }t        j                  d   |       y # 1 sw Y   y xY w# 1 sw Y   JxY w)N$A,B,C
foo,1,2,3
bar,4,5,6
baz,7,8,9
r   r	   r
   T)r         r      r            	   foobarbazABCindexcolumnsr   )
r   r   r   r   r   r   listr   r   r   r   r   r   r   r   resultr   s          r    test_iterator2r<   1   s    FD }}	!P]]:S1OOHTNTO: 2	$$	76f 
8 	Iy)#H
 &)X. 2	7	7s   B<3C<CCc                    | }d}|j                   dk(  rCd}t        j                  t        |      5  |j	                  t        |      d       d d d        y |j	                  t        |      d      5 }t        |      }d d d        t              dk(  sJ t        g dg d	g d
gg dg d      }t        j                  t        |      |       y # 1 sw Y   y xY w# 1 sw Y   `xY w)Nr#   r   zAThe 'chunksize' option is not supported with the 'pyarrow' enginer
   r%   )	chunksizer   r$   r'   r*   r.   r2   r6   )r   r   r   r   r   r   r9   lenr   r   r   r   r:   s          r    test_iterator_stop_on_chunksizer@   J   s    FD
 }}	!Q]]:S1OOHTNaO8 2	$1	5f 
6 v;!	Iy)#H
 &.(3 2	5	5s   C3CCC'r   Tr%   )r   r>   r   r>   c                     d}| }d}|j                   dk(  rd}t        j                  t        |      5   |j                  t        |      fddi|5 }	 d d d        d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)Nz('skipfooter' not supported for iterationza
1
2r   zLThe '(chunksize|iterator)' option is not supported with the 'pyarrow' enginer
   
skipfooterr%   )r   r   r   r   r   r   )r   r   r   r   r   _s         r    test_iterator_skipfooter_errorsrD   d   sx     5CFD}}	! 	
 
z	-V__Xd^DDVD E 
.	-DD 
.	-s#   A1A%A1%A.	*A11A:c                    | }dd i}t        j                         5 }t        |dd      5 }|j                  d       d d d        t        |d      5 }|D ]  }d|v s n  |j                  |fi |}t        dg di      }t        j                  ||       d d d        d d d        y # 1 sw Y   mxY w# 1 sw Y   xY w# 1 sw Y   y xY w)	Nheaderwzutf-8)encodingzAAA
BBB
CCC
DDD
EEE
FFF
GGGCCCr   )DDDEEEFFFGGG)r   ensure_cleanopenwriter   r   r   )r   r   r   pathfliner;   r   s           r    test_iteration_open_handlerT   w   s    FF		d$g.!GG78 / $)QD=  %V__Q1&1F !%A!BCH!!&(3 *	 
	.. *)	 
	s?   C B(C 
B4;B4C (B1	-C 4B=	9C  C	)__doc__ior   r   pandasr   r   pandas._testing_testingr   markfilterwarnings
pytestmarkr!   r<   r@   parametrizerD   rT        r    <module>r`      s      [[''C

4:/244 Dq1J3EUVGWX 4r_   