3
®ybX  ã               @   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   úA/tmp/pip-install-4cy230dp/pandas/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
ƒr”t|dd…< ||dd…< n| |dd…< ||dd…< ||ƒ}||ƒ}|j|ƒ}t|tƒrÞtj||ƒ ntj||ƒ ||k	söt‚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   
