Ë
    ÌiÆ  ã                   ó&   — d dl mZ  G d„ de«      Zy)é    )ÚAggregationc                   ó*   — e Zd ZdZdd„Zd„ Zd„ Zd„ Zy)ÚFirsta±  
    Returns the first value that passes a test.

    If the test is omitted, the aggregation will return the first value in the column.

    If no values pass the test, the aggregation will raise an exception.

    :param column_name:
        The name of the column to check.
    :param test:
        A function that takes a value and returns `True` or `False`. Test may be
        omitted when checking :class:`.Boolean` data.
    Nc                 ó    — || _         || _        y ©N)Ú_column_nameÚ_test)ÚselfÚcolumn_nameÚtests      úY/var/www/html/strategist-ai/venv/lib/python3.12/site-packages/agate/aggregations/first.pyÚ__init__zFirst.__init__   s   € Ø'ˆÔØˆ�
ó    c                 óH   — |j                   | j                     j                  S r   )Úcolumnsr   Ú	data_type)r
   Útables     r   Úget_aggregate_data_typezFirst.get_aggregate_data_type   s   € Ø�}‰}˜T×.Ñ.Ñ/×9Ñ9Ð9r   c                 óì   — |j                   | j                     }|j                  «       }| j                  �:t	        |D �cg c]  }| j                  |«      sŒ|‘Œ c}«      dk(  rt        d«      ‚y y c c}w )Nr   zNo values pass the given test.)r   r   Úvaluesr	   ÚlenÚ
ValueError)r
   r   ÚcolumnÚdataÚds        r   ÚvalidatezFirst.validate   se   € Ø—‘˜t×0Ñ0Ñ1ˆØ�}‰}‹ˆà�:‰:Ð!¤c°dÖ*L°¸d¿j¹jÈ½mª1Ò*LÓ&MÐQRÒ&RÜÐ=Ó>Ð>ð 'SÐ!ùÒ*Ls   ¿A1ÁA1c                 ó    ‡ — |j                   ‰ j                     }|j                  «       }‰ j                  €|d   S t	        ˆ fd„|D «       «      S )Nr   c              3   óF   •K  — | ]  }‰j                  |«      sŒ|–— Œ y ­wr   )r	   )Ú.0r   r
   s     €r   ú	<genexpr>zFirst.run.<locals>.<genexpr>'   s   øè ø€ Ò5˜! t§z¡z°!¥}”AÑ5ùs   ƒ!š!)r   r   r   r	   Únext)r
   r   r   r   s   `   r   Úrunz	First.run    sF   ø€ Ø—‘˜t×0Ñ0Ñ1ˆØ�}‰}‹ˆà�:‰:ÐØ˜‘7ˆNäÓ5˜tÔ5Ó5Ð5r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r"   © r   r   r   r      s   „ ñóò:ò?ó6r   r   N)Úagate.aggregations.baser   r   r'   r   r   ú<module>r)      s   ðÝ /ô#6ˆKõ #6r   