Ë
    ðmxi  ã            
      ó²   — d dl mZ d dlZd dlmZ d dlmZmZmZ d dl	m
Z
 d dlmZmZ d dlmZmZ erd dlmZ d d	lmZ  G d
„ de
eeef   eeeeef   «      Zy)é    )ÚannotationsN)Úreduce)ÚTYPE_CHECKINGÚAnyÚProtocol)ÚLazyNamespace)ÚNativeExprTÚNativeFrameT)ÚSQLExprTÚSQLLazyFrameT)ÚIterable)ÚPythonLiteralc                  óˆ   — e Zd Zdd„Zdd„Z	 d	 	 	 	 	 	 	 dd„Zdd„Zdd„Zdd„Zdd„Z	dd	„Z
dd
„Zdd„Z	 d	 	 	 	 	 	 	 dd„Zy)ÚSQLNamespacec                 ó   — y ©N© )ÚselfÚnameÚargss      úN/home/htdocs/ttos/venv/lib/python3.12/site-packages/narwhals/_sql/namespace.pyÚ	_functionzSQLNamespace._function   ó   � ó    c                 ó   — y r   r   )r   Úvalues     r   Ú_litzSQLNamespace._lit   r   r   Nc                 ó   — y r   r   )r   Ú	conditionr   Ú	otherwises       r   Ú_whenzSQLNamespace._when   s   € ð
 r   c                 ó   — y r   r   )r   Úexprss     r   Ú	_coalescezSQLNamespace._coalesce   r   r   c               óN   ‡ ‡— dˆˆ fd„} ‰ j                   j                  |g|¢­Ž S )Nc                óR   •— ‰rˆfd„| D «       } t        t        j                  | «      S )Nc              3  ó`   •K  — | ]%  }‰j                  |‰j                  d «      «      –— Œ' y­w)FN©r$   r   ©Ú.0Úcolr   s     €r   ú	<genexpr>z<SQLNamespace.any_horizontal.<locals>.func.<locals>.<genexpr>#   s%   øè ø€ ÒNÀ#˜Ÿ™ s¨D¯I©I°eÓ,<×=ÑNùó   ƒ+.)r   ÚoperatorÚor_©ÚcolsÚignore_nullsr   s    €€r   Úfuncz)SQLNamespace.any_horizontal.<locals>.func!   s!   ø€ ÙÛNÈÔN�Üœ(Ÿ,™,¨Ó-Ð-r   ©r1   zIterable[NativeExprT]Úreturnr	   ©Ú_exprÚ_from_elementwise_horizontal_op©r   r2   r#   r3   s   ``  r   Úany_horizontalzSQLNamespace.any_horizontal    s&   ù€ ö	.ð
 :ˆt�z‰z×9Ñ9¸$ÐGÀÒGÐGr   c               óN   ‡ ‡— dˆˆ fd„} ‰ j                   j                  |g|¢­Ž S )Nc                óR   •— ‰rˆfd„| D «       } t        t        j                  | «      S )Nc              3  ó`   •K  — | ]%  }‰j                  |‰j                  d «      «      –— Œ' y­w)TNr(   r)   s     €r   r,   z<SQLNamespace.all_horizontal.<locals>.func.<locals>.<genexpr>+   s$   øè ø€ ÒMÀ˜Ÿ™ s¨D¯I©I°d«O×<ÑMùr-   )r   r.   Úand_r0   s    €€r   r3   z)SQLNamespace.all_horizontal.<locals>.func)   s!   ø€ ÙÛMÈÔM�Üœ(Ÿ-™-¨Ó.Ð.r   r4   r6   r9   s   ``  r   Úall_horizontalzSQLNamespace.all_horizontal(   s&   ù€ ö	/ð
 :ˆt�z‰z×9Ñ9¸$ÐGÀÒGÐGr   c                óJ   ‡ — dˆ fd„} ‰ j                   j                  |g|¢­Ž S )Nc                ó*   •—  ‰j                   dg| ¢­Ž S )NÚgreatest©r   ©r1   r   s    €r   r3   z)SQLNamespace.max_horizontal.<locals>.func1   s   ø€ Ø!�4—>‘> *Ð4¨tÒ4Ð4r   r4   r6   ©r   r#   r3   s   `  r   Úmax_horizontalzSQLNamespace.max_horizontal0   s&   ø€ õ	5ð :ˆt�z‰z×9Ñ9¸$ÐGÀÒGÐGr   c                óJ   ‡ — dˆ fd„} ‰ j                   j                  |g|¢­Ž S )Nc                ó*   •—  ‰j                   dg| ¢­Ž S )NÚleastrC   rD   s    €r   r3   z)SQLNamespace.min_horizontal.<locals>.func7   s   ø€ Ø!�4—>‘> 'Ð1¨DÒ1Ð1r   r4   r6   rE   s   `  r   Úmin_horizontalzSQLNamespace.min_horizontal6   s&   ø€ õ	2ð :ˆt�z‰z×9Ñ9¸$ÐGÀÒGÐGr   c                óJ   ‡ — dˆ fd„} ‰ j                   j                  |g|¢­Ž S )Nc                óJ   •— t        t        j                  ˆfd„| D «       «      S )Nc              3  ó`   •K  — | ]%  }‰j                  |‰j                  d «      «      –— Œ' y­w)r   Nr(   r)   s     €r   r,   z<SQLNamespace.sum_horizontal.<locals>.func.<locals>.<genexpr>?   s$   øè ø€ ÒQÀS˜tŸ~™~¨c°4·9±9¸Q³<×@ÑQùr-   )r   r.   ÚaddrD   s    €r   r3   z)SQLNamespace.sum_horizontal.<locals>.func=   s   ø€ ÜÜ—‘ÓQÈDÔQóð r   r4   r6   rE   s   `  r   Úsum_horizontalzSQLNamespace.sum_horizontal<   s&   ø€ õ	ð
 :ˆt�z‰z×9Ñ9¸$ÐGÀÒGÐGr   c                óJ   ‡ — dˆ fd„} ‰ j                   j                  |g|¢­Ž S )Nc                ó"   •—  ‰j                   | Ž S r   )r$   rD   s    €r   r3   z#SQLNamespace.coalesce.<locals>.funcF   s   ø€ Ø!�4—>‘> 4Ð(Ð(r   r4   r6   rE   s   `  r   ÚcoalescezSQLNamespace.coalesceE   s&   ø€ õ	)ð :ˆt�z‰z×9Ñ9¸$ÐGÀÒGÐGr   c                ó–   ‡ — dˆ fd„}dˆ fd„}|€‰ j                   j                  |||«      S ‰ j                   j                  ||||«      S )Nc                ó4   •— ‰j                  | d   | d   «      S )Né   r   ©r!   rD   s    €r   r3   z$SQLNamespace.when_then.<locals>.funcN   s   ø€ Ø—:‘:˜d 1™g t¨A¡wÓ/Ð/r   c                ó<   •— ‰j                  | d   | d   | d   «      S )NrU   r   é   rV   rD   s    €r   Úfunc_with_otherwisez3SQLNamespace.when_then.<locals>.func_with_otherwiseQ   s"   ø€ Ø—:‘:˜d 1™g t¨A¡w°°Q±Ó8Ð8r   )r1   zlist[NativeExprT]r5   r	   r6   )r   Ú	predicateÚthenr    r3   rY   s   `     r   Ú	when_thenzSQLNamespace.when_thenK   sN   ø€ õ	0õ	9ð ÐØ—:‘:×=Ñ=¸dÀDÈ)ÓTÐTØ�z‰z×9Ñ9Ø  y°)ó
ð 	
r   )r   Ústrr   zNativeExprT | PythonLiteralr5   r	   )r   r   r5   r	   r   )r   r	   r   r	   r    zNativeExprT | Noner5   r	   )r#   r	   r5   r	   )r#   r   r2   Úboolr5   r   )r#   r   r5   r   )rZ   r   r[   r   r    zSQLExprT | Noner5   r   )Ú__name__Ú
__module__Ú__qualname__r   r   r!   r$   r:   r?   rF   rJ   rO   rR   r\   r   r   r   r   r      s‘   „ ó [Û2ð
 )-ð	àðð ðð &ð	ð
 
óó AóHóHóHóHóHóHð QUð
Ø!ð
Ø)1ð
Ø>Mð
à	ô
r   r   )Ú
__future__r   r.   Ú	functoolsr   Útypingr   r   r   Únarwhals._compliantr   Únarwhals._compliant.typingr	   r
   Únarwhals._sql.typingr   r   Úcollections.abcr   Únarwhals.typingr   r   r   r   r   ú<module>rj      sR   ðÝ "ã Ý ß /Ñ /å -ß @ß 8áÝ(å-ôG
Ø�- ¨<Ð7Ñ8Øˆ]˜H l°KÐ?Ñ@õG
r   