§
    tŠtjý  ã                   ó    — d dl Zd dlZd dlmZmZ d dlmZ  G d„ de¦  «        Z G d„ d¦  «        Z	 ej
        de	g¬¦  «        d	„ ¦   «         ZdS )
é    N)Ú	DataFrameÚSeries)ÚBaseExecutionEnginec                   ó   — e Zd ZdZd„ Zd„ ZdS )ÚMockExecutionEnginea×  
    Execution Engine to test if the execution engine interface receives and
    uses all parameters provided by the user.

    Making this engine work as the default Python engine by calling it, no extra
    functionality is implemented here.

    When testing, this will be called when this engine is provided, and then the
    same pandas.map and pandas.apply function will be called, but without engine,
    executing the default behavior from the python engine.
    c                 ó\   — t          | t          ¦  «        r|ni } | j        |fd|rdnd i|¤ŽS )NÚ	na_actionÚignore)Ú
isinstancer   Úmap)ÚdataÚfuncÚargsÚkwargsÚ	decoratorÚskip_naÚkwargs_to_passs          úY/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/pandas/tests/apply/conftest.pyr   zMockExecutionEngine.map   sB   € Ý#-¨dµIÑ#>Ô#>ÐF˜˜ÀBˆØˆtŒx˜ÐXÐX°GÐ(E¨¨ÀÐXÈÐXÐXÐXó    c           	      ó.  — t          | t          ¦  «        r|                      |d|d¬¦  «        S t          | t          ¦  «        r | j        |f|dd |ddœ|¤ŽS t          | t          j        ¦  «        sJ ‚d„ }t	          j         ||¦  «        || g|¢R i |¤ŽS )NTF)Úconvert_dtyper   Úby_rowÚcompat)ÚaxisÚrawÚresult_typer   r   c                 ó   ‡ — ˆ fd„}|S )Nc                  óx   •—  ‰| i |¤Ž}t          |t          ¦  «        rt          j        |t          ¬¦  «        }|S )N)Údtype)r   ÚstrÚnpÚarrayÚobject)r   r   Úresultr   s      €r   ÚwrapperzAMockExecutionEngine.apply.<locals>.wrap_function.<locals>.wrapper.   sC   ø€ Ø!˜T 4Ð2¨6Ð2Ð2�FÝ! &­#Ñ.Ô.ð @Ý!#¤¨&½Ð!?Ñ!?Ô!?˜Ø!�Mr   © )r   r%   s   ` r   Úwrap_functionz0MockExecutionEngine.apply.<locals>.wrap_function,   s#   ø€ ð"ð "ð "ð "ð "ð �r   )r   r   Úapplyr   r!   ÚndarrayÚapply_along_axis)r   r   r   r   r   r   r'   s          r   r(   zMockExecutionEngine.apply   sÙ   € Ý�d�FÑ#Ô#ð 	YØ—:’:˜d°$¸TÈ%�:ÑPÔPÐPÝ˜�iÑ(Ô(ð 	YØ�4”:ØðàØØ ØØðð ð ðð ð õ ˜d¥B¤JÑ/Ô/Ð/Ð/Ð/ðð ð õ Ô& } }°TÑ':Ô':¸DÀ$ÐXÈÐXÐXÐXÐQWÐXÐXÐXr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r(   r&   r   r   r   r      sD   € € € € € ð
ð 
ðYð Yð YðYð Yð Yð Yð Yr   r   c                   ó   — e Zd ZeZdS )ÚMockEngineDecoratorN)r+   r,   r-   r   Ú__pandas_udf__r&   r   r   r0   r0   9   s   € € € € € Ø(€N€N€Nr   r0   )Úparamsc                 ó   — | j         S )N)Úparam)Úrequests    r   Úenginer6   =   s
   € àŒ=Ðr   )Únumpyr!   ÚpytestÚpandasr   r   Úpandas.api.executorsr   r   r0   Úfixturer6   r&   r   r   ú<module>r<      sí   ðØ Ð Ð Ð Ø €€€ðð ð ð ð ð ð ð ð 5Ð 4Ð 4Ð 4Ð 4Ð 4ð+Yð +Yð +Yð +Yð +YÐ-ñ +Yô +Yð +Yð\)ð )ð )ð )ð )ñ )ô )ð )ð €„˜Ð1Ð2Ð3Ñ3Ô3ðð ñ 4Ô3ðð ð r   