a
    DBìjB  ã                   @   sœ   d Z ddlmZ ddlZddlZddlmZmZ ddl	m
Z ej d¡Zej d¡Zeej ddd	g¡d
d„ ƒƒZeej ddd	g¡dd„ ƒƒZ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.
é    )ÚStringION)Ú	DataFrameÚoption_contextz=ignore:Passing a BlockManager to DataFrame:DeprecationWarningZpyarrow_xfailÚ	na_filterTFc                 C   sP   | }d}t dtdƒtdƒgd ig d¢d�}|jt|ƒd|d	�}t ||¡ d S )
NzE,A
a,inf
b,-inf
c,+Inf
d,-Inf
e,INF
f,-INF
g,+INf
h,-INf
i,inF
j,-inFÚAÚinfz-infé   )
ÚaÚbÚcÚdÚeÚfÚgÚhÚiÚj©Úindexr   ©Z	index_colr   ©r   ÚfloatÚread_csvr   ÚtmÚassert_frame_equal©Úall_parsersr   ÚparserÚdataÚexpectedÚresult© r!   úe/mnt/bigstor/www/usecases/.venv/lib/python3.9/site-packages/pandas/tests/io/parser/common/test_inf.pyÚtest_inf_parsing   s    þr#   c                 C   sR   | }d}t dtdƒtdƒtdƒgig d¢d�}|jt|ƒd|d	�}t ||¡ d S )
Nz&,A
a,Infinity
b,-Infinity
c,+Infinity
r   Úinfinityz	-infinityz	+infinity)r	   r
   r   r   r   r   r   r   r!   r!   r"   Útest_infinity_parsing/   s    þr%   c              	   C   s®   | }d}d}t }|jdkr"t tf}tj||dd��L tddƒ�" |jt|ƒd d�}W d   ƒ n1 sf0    Y  W d   ƒ n1 s„0    Y  td	t	j
d
gƒ}t ||¡ d S )Nz1.0
NaN
3.0z"use_inf_as_na option is deprecatedZpyarrowF)ÚmatchZcheck_stacklevelZuse_inf_as_naT)Úheaderg      ð?g      @)ÚFutureWarningZengineÚDeprecationWarningr   Zassert_produces_warningr   r   r   r   ÚnpÚnanr   )r   r   r   ÚmsgÚwarnr    r   r!   r!   r"   Ú test_read_csv_with_use_inf_as_naA   s    
Nr.   )Ú__doc__Úior   Únumpyr*   ZpytestZpandasr   r   Zpandas._testingZ_testingr   ÚmarkÚfilterwarningsZ
pytestmarkZusefixturesZxfail_pyarrowZparametrizer#   r%   r.   r!   r!   r!   r"   Ú<module>   s    ÿ