
    Eg*                         d Z ddlmZ ddlmZ ddlZddlZddlmZmZm	Z	 ddl
mZ ej                            d          Zej                            d          Zej                            d          Zej                            d	d
dg dd eg dg dg dg dg dg dg eg dd          g d          fdddgg dd eg dg dg dg dg dg e	j        g dddg          g d          fg          d             Zej                            dddgddgg          d             Zed             Zeej                            d d! ed"d#g$          dgfd% e e	j        d&d'g          $          ddgfg          ej                            d(d)d*g          d+                                     Zed,             Zd- Zed.             Zed/             Zed0             Zed1             Zed2             ZdS )3zy
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
    )datetime)StringION)	DataFrameIndex
MultiIndexz=ignore:Passing a BlockManager to DataFrame:DeprecationWarningpyarrow_xfailpyarrow_skipzdata,kwargs,expectedz[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ABCD)	index_colnames                  	   
               )foobarbazquxfoo2bar2r
   namer   r   r   r   )r
   columnsz_foo,one,2,3,4,5
foo,two,7,8,9,10
foo,three,12,13,14,15
bar,one,12,13,14,15
bar,two,12,13,14,15
   )index1index2r   r   r   r   )r    one)r    two)r    three)r!   r.   )r!   r/   r+   r,   r   c                 j    | } |j         t          |          fi |}t          j        ||           d S )N)read_csvr   tmassert_frame_equal)all_parsersdatakwargsexpectedparserresults         ]/var/www/sysmax/venv/lib/python3.11/site-packages/pandas/tests/io/parser/common/test_index.pytest_pass_names_with_indexr=      sB    r FV_Xd^^66v66F&(+++++    r   c                 T   d}d                     |                    d          dd                    }g d}| }|                    t          |          |d |          }|                    t          |          |          }d gdz  |j        _        t          j        ||           d S )Nzuindex1,index2,A,B,C,D
foo,one,2,3,4,5
foo,two,7,8,9,10
foo,three,12,13,14,15
bar,one,12,13,14,15
bar,two,12,13,14,15

r*   r(   )r   headerr   r   r   )joinsplitr3   r   r
   r   r4   r5   )r6   r   r7   headless_datar   r:   r;   r9   s           r<   test_multi_index_no_level_namesrF   X   s    D IIdjj..qrr233M   EF__9T   F x~~CCH !6A:HN&(+++++r>   c                     | }d}|                     t          |                    }t          g dg dg dg dg dgg dt          j        g d                    }t          j        ||           d S )NzgA,B,C,D
foo,one,2,3,4,5
foo,two,7,8,9,10
foo,three,12,13,14,15
bar,one,12,13,14,15
bar,two,12,13,14,15
r   r   r   r(   r-   r)   r
   )r3   r   r   r   from_tuplesr4   r5   r6   r:   r7   r;   r9   s        r<   (test_multi_index_no_level_names_implicitrK   p   s    FD __Xd^^,,FLLMM	
 %$$$  
 
  H& &(+++++r>   zdata,expected,headerza,babr)   za,b
c,d)rL   c)rM   d
round_tripTFc                     | }|r|                     d          n|}|                    t          |          |          }t          j        ||           d S )NF)r
   )rA   )to_csvr3   r   r4   r5   )r6   r7   r9   rA   rQ   r:   r;   s          r<   test_multi_index_blank_dfrT      sZ     F+5?8???'''4D__Xd^^F_;;F&(+++++r>   c                     | }d}|                     t          |          d          }t          g dg dg dgg d          }t          j        ||           d S )	Nz+ id c0 c1 c2
0 1 0 a b
1 2 0 c d
2 2 2 e f
 )sep)r   r*   r   rL   rM   )r*   r   r   rO   rP   )r   r   r   ef)z
Unnamed: 0idc0c1c2rN   )r3   r   r   r4   r5   rJ   s        r<   test_no_unnamed_indexr^      s    FD
 __Xd^^_55F			1113F3F3FG666  H &(+++++r>   c           	          d}| }|                     t          |          d          }t          g dg dg dg dg dg dgg dt          g dd	
                    }t	          j        ||           d S )Nzgindex,A,B,C,D
foo,2,3,4,5
bar,7,8,9,10
baz,12,13,14,15
qux,12,13,14,15
foo,12,13,14,15
bar,12,13,14,15
r   rB   r   r   r   r(   r    r!   r"   r#   r    r!   r
   r&   rH   r3   r   r   r   r4   r5   r6   r7   r:   r;   r9   s        r<   "test_read_duplicate_index_explicitrc      s    D F__Xd^^q_99FLLMM	
 %$$>>>WMMM  H &(+++++r>   c           	          d}| }|                     t          |                    }t          g dg dg dg dg dg dgg dt          g d                    }t	          j        ||           d S )NzaA,B,C,D
foo,2,3,4,5
bar,7,8,9,10
baz,12,13,14,15
qux,12,13,14,15
foo,12,13,14,15
bar,12,13,14,15
r   r   r   r(   r`   rH   ra   rb   s        r<   "test_read_duplicate_index_implicitre      s    D F__Xd^^,,FLLMM	
 %$$>>>??  H &(+++++r>   c                    | }t           j                            |d          }|                    |dd          }t	          g dg dg dg dg d	gg d
t          t          ddd          t          ddd          t          ddd          t          ddd          t          ddd          g                    }t          j        ||           d S )Nz	test2.csvr   T)r   parse_dates)gA	]^?gֈ`|@g% TO׿gnIr    )g=HOC?gW\g~q"BĿg=4?r!   )gZH?g7ne?g>ݦ4g_YiR?r"   )g䞮X?gt]?gnk3Am?g-?r#   )gP,߿g~W[I?gN6gFgZ&|?r$   )r   r   r   r   Ei  r*   r   r   r      r   rH   )	ospathrC   r3   r   r   r   r4   r5   )r6   csv_dir_pathr:   csv2r;   r9   s         r<   test_read_csv_no_index_namern      s    F7<<k22D__TQD_AAFCCCBBBBBBCCCBBB	
 *))q!$$q!$$q!$$q!$$q!$$
 
  H& &(+++++r>   c                     d}| }|                     t          |          d          }t          dgt          g d                    }t	          j        ||           d S )Nzx,yr   rB   yxr&   rH   ra   rb   s        r<   test_empty_with_indexrr     sc     DF__Xd^^q_99F#eBS.A.A.ABBBH&(+++++r>   c                     d}| }|                     t          |          ddg          }t          dgt          j        g gdz  ddg                    }t          j        ||           d S )	Nx,y,zrq   rp   rB   zr   r1   rH   r3   r   r   r   from_arraysr4   r5   rb   s        r<   test_empty_with_multi_indexrx     s}     DF__Xd^^Sz_BBFZ3RD1HS#JOOO  H &(+++++r>   c                     d}| }|                     t          |          ddg          }t          dgt          j        g gdz  ddg	          
          }t          j        ||           d S )Nrt   r*   r   rB   ru   r   rp   rq   r1   rH   rv   rb   s        r<   $test_empty_with_reversed_multi_indexrz   %  s{    DF__Xd^^1v_>>FZ3RD1HS#JOOO  H &(+++++r>   ) __doc__r   ior   rj   pytestpandasr   r   r   pandas._testing_testingr4   markfilterwarnings
pytestmarkusefixturesxfail_pyarrowskip_pyarrowparametrizerI   r=   rF   rK   rT   r^   rc   re   rn   rr   rx   rz    r>   r<   <module>r      s                				          
      [''C 
 ''88{&&~66  &C&C&CDDI LL!MM$$$$$$$$$$$$ eHHHwWWW,,,  	
. a&+S+S+STTI LL!MM$$$$$$$$$ -j,   $X.	 	 	 -,,%  	
/47 7p, ,q7 7p, 1v1v&677, , 87,. , , ,B 			3*---s3I4j4j*5MNNOOOF	

 
 e}55, , 65
 
 , , , ,, , ,6 , , ,6 , , ,6 , , , 	, 	, 	, , , , , ,r>   