o
    ChM                      @   s  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dg d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dg ddfgdd Zejdddgddggdd  Zed!d" Zeejd#d$ed%d&gd'dgfd(ee	d)d*gd'ddgfgejd+d,d-gd.d/ Zed0d1 Zd2d3 Zed4d5 Zed6d7 Zed8d9 Zed:d; Zed<d= ZdS )>zy
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                 C   s*   | }|j t|fi |}t|| d S )N)read_csvr   tmassert_frame_equal)all_parsersdatakwargsexpectedparserresult r:   z/var/www/html/myvaluetrips/my_value_trip_new/venv/lib/python3.10/site-packages/pandas/tests/io/parser/common/test_index.pytest_pass_names_with_index   s   9r<   r   c           
      C   sn   d}d |ddd  }g d}|}|jt||d |d}|jt||d}	d gd |	j_t||	 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splitr1   r   r	   r   r2   r3   )
requestr4   r   using_infer_stringr5   headless_datar   r8   r9   r7   r:   r:   r;   test_multi_index_no_level_namesX   s   rE   c                 C   s`   | }d}| t|}tg dg dg dg dg dgg dtg dd}t|| 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	   )r1   r   r   r   from_tuplesr2   r3   r4   r8   r5   r9   r7   r:   r:   r;   (test_multi_index_no_level_names_implicitr   s    rI   zdata,expected,headerza,babr(   za,b
c,d)rJ   c)rK   d
round_tripTFc                 C   s:   | }|r
|j ddn|}|jt||d}t|| d S )NF)r	   )r>   )to_csvr1   r   r2   r3   )r4   r5   r7   r>   rO   r8   r9   r:   r:   r;   test_multi_index_blank_df   s   rQ   c                 C   sL   | }d}|j t|dd}tg dg dg dgg dd}t|| 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   rJ   rK   )r)   r   r   rM   rN   )r   r   r   ef)z
Unnamed: 0idc0c1c2rL   )r1   r   r   r2   r3   rH   r:   r:   r;   test_no_unnamed_index   s   rZ   c                 C   sl   d}| }|j t|dd}tg dg dg dg dg dg dgg dtg dd	d
d}t|| 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   r?   r   r   r   r'   r   r    r!   r"   r   r    r	   r%   rF   r1   r   r   r   r2   r3   r4   r5   r8   r9   r7   r:   r:   r;   "test_read_duplicate_index_explicit   s   r^   c                 C   sd   d}| }| t|}tg dg dg dg dg dg dgg dtg dd}t|| 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[   rF   r\   r]   r:   r:   r;   "test_read_duplicate_index_implicit   s   
r_   c                 C   s   | }t j|d}|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d}t|| 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   rF   )	ospathr@   r1   r   r   r   r2   r3   )r4   csv_dir_pathr8   csv2r9   r7   r:   r:   r;   test_read_csv_no_index_name   s*   




rg   c                 C   s@   d}| }|j t|dd}tdgtg ddd}t|| d S )Nzx,yr   r?   yxr%   rF   r\   r]   r:   r:   r;   test_empty_with_index  s
   rj   c                 C   sP   d}| }|j t|ddgd}tdgtjg gd ddgdd}t|| d S )	Nx,y,zri   rh   r?   zr   r0   rF   r1   r   r   r   from_arraysr2   r3   r]   r:   r:   r;   test_empty_with_multi_index  s   ro   c                 C   sP   d}| }|j t|ddgd}tdgtjg gd ddgd	d
}t|| d S )Nrk   r)   r   r?   rl   r   rh   ri   r0   rF   rm   r]   r:   r:   r;   $test_empty_with_reversed_multi_index'  s   rp   ) __doc__r   ior   rc   pytestpandasr   r   r   pandas._testing_testingr2   markfilterwarnings
pytestmarkusefixturesxfail_pyarrowskip_pyarrowparametrizerG   r<   rE   rI   rQ   rZ   r^   r_   rg   rj   ro   rp   r:   r:   r:   r;   <module>   s    

8

!	




