U
    f/eX                     @   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mZ ddlmZ dd	 Ze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d t|dkr.|jd nd}||}t |trTt	|| nt
|| ||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   A/tmp/pip-unpacked-wheel-tiezk1ph/pandas/tests/base/test_fillna.pytest_fillna   s    



r   null_objc                 C   s   |}t |}t|s&t| d n4t|dk r>td nt|trZtd|  d |j}|d }| }t	|j
rt|dd< ||dd< n| |dd< ||dd< ||}||}||}t|trt|| nt|| ||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   