
    [i              
          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      h/var/www/html/userprofiledev.eatanceapp.com/venv/lib/python3.12/site-packages/narwhals/_sql/namespace.py	_functionzSQLNamespace._function   s    WZ    c                     y r   r   )r   values     r   _litzSQLNamespace._lit   s    sr   Nc                     y r   r   )r   	conditionr   	otherwises       r   _whenzSQLNamespace._when   s    
 r   c                     y r   r   )r   exprss     r   	_coalescezSQLNamespace._coalesce   s    Sr   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,<=   +.)r   operatoror_colsignore_nullsr   s    r   funcz)SQLNamespace.any_horizontal.<locals>.func!   s!    NN(,,--r   r0   zIterable[NativeExprT]returnr	   _expr_from_elementwise_horizontal_opr   r1   r"   r2   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<r,   )r   r-   and_r/   s    r   r2   z)SQLNamespace.all_horizontal.<locals>.func)   s!    MM(--..r   r3   r5   r8   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   r0   r   s    r   r2   z)SQLNamespace.max_horizontal.<locals>.func1   s    !4>>*4t44r   r3   r5   r   r"   r2   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leastrB   rC   s    r   r2   z)SQLNamespace.min_horizontal.<locals>.func7   s    !4>>'1D11r   r3   r5   rD   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                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%     QDSt~~c499Q<@Dr,   )r   r-   addrC   s    r   r2   z)SQLNamespace.sum_horizontal.<locals>.func=   s    QDQ r   r3   r5   rD   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#   rC   s    r   r2   z#SQLNamespace.coalesce.<locals>.funcF   s    !4>>4((r   r3   r5   rD   s   `  r   coalescezSQLNamespace.coalesceE   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    rC   s    r   r2   z$SQLNamespace.when_then.<locals>.funcN   s    ::d1gtAw//r   c                <    j                  | d   | d   | d         S )NrT   r      rU   rC   s    r   func_with_otherwisez3SQLNamespace.when_then.<locals>.func_with_otherwiseQ   s"    ::d1gtAwQ88r   )r0   zlist[NativeExprT]r4   r	   r5   )r   	predicatethenr   r2   rX   s   `     r   	when_thenzSQLNamespace.when_thenK   sN    	0	9 ::==dD)TTzz99y)
 	
r   )r   strr   zNativeExprT | PythonLiteralr4   r	   )r   r   r4   r	   r   )r   r	   r   r	   r   zNativeExprT | Noner4   r	   )r"   r	   r4   r	   )r"   r   r1   boolr4   r   )r"   r   r4   r   )rY   r   rZ   r   r   zSQLExprT | Noner4   r   )__name__
__module____qualname__r   r   r    r#   r9   r>   rE   rI   rN   rQ   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>ri      sR    "   / / - @ 8(-G
-<78]HlK?@G
r   