U
    ÎZjò  ã                   @   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„ 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)Ú
MultiIndex)Úallow_na_opsc              	   C   sz   | }t |tƒr:d}tjt|d�� | d¡ W 5 Q R X d S t|ƒdkrP|jd nd}| |¡}t 	||¡ ||k	svt
‚d S )Nz"isna is not defined for MultiIndex)Úmatchr   )Ú
isinstancer   ÚpytestZraisesÚNotImplementedErrorÚfillnaÚlenÚvaluesÚtmÚassert_equalÚAssertionError)Úindex_or_series_objÚobjÚmsgÚ
fill_valueÚresult© r   ú`/var/www/html/TRUCKING_PROJECT/venv/lib/python3.8/site-packages/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 }| ¡ }| |dd…< ||dd…< ||ƒ}||ƒ}| 	|¡}t
 ||¡ ||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   Úskipr	   r   r   Z_valuesÚcopyr   r   r   r   )r   r   r   Úklassr
   r   Úexpectedr   r   r   r   Útest_fillna_null"   s$    

r   )Ú__doc__ÚnumpyÚnpr   Zpandasr   Zpandas._testingZ_testingr   Zpandas.tests.base.commonr   r   ÚmarkZparametrizeÚnanr   r   r   r   r   Ú<module>   s   