3
UdX                 @   s   d Z ddlZddlZddlmZ ddlmZ ddlm	Z	 ddl
mZ ddljZddlmZ dd	 Zejjd
ejdgdd ZdS )zg
Though Index.fillna and Series.fillna has separate impl,
test here to confirm these works as the same
    N)iNaT)needs_i8_conversion)ABCMultiIndex)Index)allow_na_opsc             C   sp   | }t |trtjd t|dkr.|jd nd}|j|}t |trTtj	|| ntj
|| ||k	sltd S )NzMultiIndex doesn't support isnar   )
isinstancer   pytestskiplenvaluesfillnar   tmassert_index_equalassert_series_equalAssertionError)index_or_series_objobj
fill_valueresult r   Q/var/www/html/virt/lib64/python3.6/site-packages/pandas/tests/base/test_fillna.pytest_fillna   s    



r   null_objc             C   s   |}t |}t|s&tj| d n4t|dk r>tjd nt|trZtjd|  d |j}|d }|j }t	|j
rt|dd< ||dd< n| |dd< ||dd< ||}||}|j|}t|trtj|| ntj|| ||k	std S )Nz  doesn't allow for NA operations   z%Test doesn't make sense on empty datazMultiIndex can't hold ''r      )typer   r   r	   r
   r   r   r   copyr   Zdtyper   r   r   r   r   r   r   )r   r   r   klassr   r   expectedr   r   r   r   test_fillna_null%   s.    



r    )__doc__Znumpynpr   Zpandas._libsr   Zpandas.core.dtypes.commonr   Zpandas.core.dtypes.genericr   Zpandasr   Zpandas._testingZ_testingr   Zpandas.tests.base.commonr   r   markZparametrizenanr    r   r   r   r   <module>   s   
