
    7^jW              
          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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Sequence)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      b/var/www/ramen.bs-engineer-server.com/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#sDIIe,<=N   +.)r   operatoror_colsignore_nullsr   s    r   funcz)SQLNamespace.any_horizontal.<locals>.func!   s!    NN(,,--r   r3   zIterable[NativeExprT]returnr
   _expr_from_elementwise_horizontal_opr   r4   r%   r5   s   ``  r   any_horizontalzSQLNamespace.any_horizontal    s&    	.
 :tzz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sDIIdO<Mr/   )r   r0   and_r2   s    r   r5   z)SQLNamespace.all_horizontal.<locals>.func)   s!    MM(--..r   r6   r8   r;   s   ``  r   all_horizontalzSQLNamespace.all_horizontal(   s&    	/
 :tzz99$GGGr   c                J     d fd}  j                   j                  |g| S )Nc                *     j                   dg|  S )Ngreatestr   r3   r   s    r   r5   z)SQLNamespace.max_horizontal.<locals>.func1   s    !4>>*4t44r   r6   r8   r   r%   r5   s   `  r   max_horizontalzSQLNamespace.max_horizontal0   s&    	5 :tzz99$GGGr   c                J     d fd}  j                   j                  |g| S )Nc                *     j                   dg|  S )NleastrE   rF   s    r   r5   z)SQLNamespace.min_horizontal.<locals>.func7   s    !4>>'1D11r   r6   r8   rG   s   `  r   min_horizontalzSQLNamespace.min_horizontal6   s&    	2 :tzz99$GGGr   c                J     d fd}  j                   j                  |g| S )Nc                4    t        fdfd| D              S )Nc                *    j                  d| |      S )NaddrE   )xyr   s     r   <lambda>z;SQLNamespace.sum_horizontal.<locals>.func.<locals>.<lambda>?   s    T^^E1a8 r   c              3  `   K   | ]%  }j                  |j                  d              ' yw)r   Nr*   r+   s     r   r.   z<SQLNamespace.sum_horizontal.<locals>.func.<locals>.<genexpr>@   s$     CsTYYq\2Cr/   r   rF   s    r   r5   z)SQLNamespace.sum_horizontal.<locals>.func=   s    8CdC r   r6   r8   rG   s   `  r   sum_horizontalzSQLNamespace.sum_horizontal<   s&    	 :tzz99$GGGr   c                J     d fd}  j                   j                  |g| S )Nc                "     j                   |  S r   )r&   rF   s    r   r5   z#SQLNamespace.coalesce.<locals>.funcG   s    !4>>4((r   r6   r8   rG   s   `  r   coalescezSQLNamespace.coalesceF   s&    	) :tzz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#   rF   s    r   r5   z$SQLNamespace.when_then.<locals>.funcO   s    ::d1gtAw//r   c                <    j                  | d   | d   | d         S )Nr[   r      r\   rF   s    r   func_with_otherwisez3SQLNamespace.when_then.<locals>.func_with_otherwiseR   s"    ::d1gtAwQ88r   )r3   zSequence[NativeExprT]r7   r
   r8   )r   	predicatethenr"   r5   r_   s   `     r   	when_thenzSQLNamespace.when_thenL   sN    	0	9 ::==dD)TTzz99y)
 	
r   )r   strr   zNativeExprT | PythonLiteralr7   r
   )r   r   r7   r
   r   )r!   r
   r   r
   r"   zNativeExprT | Noner7   r
   )r%   r
   r7   r
   )r%   r   r4   boolr7   r   )r%   r   r7   r   )r`   r   ra   r   r"   zSQLExprT | Noner7   r   )__name__
__module____qualname__r   r   r#   r&   r<   rA   rH   rL   rU   rX   rb   r   r   r   r   r      s     [2
 )-	  &	
 
 AHHHHHH QU
!
)1
>M
	
r   r   )
__future__r   r0   	functoolsr   typingr   r   r   narwhals._compliantr	   narwhals._compliant.typingr
   r   narwhals._sql.typingr   r   collections.abcr   r   narwhals.typingr   r   r   r   r   <module>rp      sR    "   / / - @ 82-H
-<78]HlK?@H
r   