o
    Û­jò  ã                   @   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   s�   | }t |tƒr(d}tjt|d�� | d¡ W d   ƒ d S 1 s!w   Y  d S t|ƒdkr3|jd nd}| |¡}t 	||¡ ||usFJ ‚d S )Nz"isna is not defined for MultiIndex)Úmatchr   )
Ú
isinstancer   ÚpytestÚraisesÚNotImplementedErrorÚfillnaÚlenÚvaluesÚtmÚassert_equal)Úindex_or_series_objÚobjÚmsgÚ
fill_valueÚresult© r   úZ/var/www/html/CropPilot/venv/lib/python3.10/site-packages/pandas/tests/base/test_fillna.pyÚtest_fillna   s   

ÿþ
r   Únull_objc                 C   s¾   |}t |ƒ}t|ƒst |› d�¡ nt|ƒdk rt d¡ nt|tƒr-t d| › d�¡ |j}|d }| ¡ }| |dd…< ||dd…< ||ƒ}||ƒ}| 	|¡}t
 ||¡ ||us]J ‚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   Ú_valuesÚcopyr	   r   r   )r   r   r   Úklassr   r   Úexpectedr   r   r   r   Útest_fillna_null"   s$   

r    )Ú__doc__ÚnumpyÚnpr   Úpandasr   Úpandas._testingÚ_testingr   Úpandas.tests.base.commonr   r   ÚmarkÚparametrizeÚnanr    r   r   r   r   Ú<module>   s    