
    Wh
              
          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_co)SQLExprTSQLLazyFrameT)Iterable)PythonLiteralc                  n    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y)SQLNamespacec                     y N )selfnameargss      Q/var/www/html/jupyter_env/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   r1   zIterable[NativeExprT]returnr	   _expr_from_elementwise_horizontal_opr   r2   r#   r3   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   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&    	/
 :tzz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>>*4t44r   r4   r6   r   r#   r3   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leastrC   rD   s    r   r3   z)SQLNamespace.min_horizontal.<locals>.func7   s    !4>>'1D11r   r4   r6   rE   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$     QSt~~c499Q<@Qr-   )r   r.   addrD   s    r   r3   z)SQLNamespace.sum_horizontal.<locals>.func=   s    QDQ r   r4   r6   rE   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$   rD   s    r   r3   z#SQLNamespace.coalesce.<locals>.funcF   s    !4>>4((r   r4   r6   rE   s   `  r   coalescezSQLNamespace.coalesceE   s&    	) :tzz99$GGGr   )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   )__name__
__module____qualname__r   r   r!   r$   r:   r?   rF   rJ   rO   rR   r   r   r   r   r      se     [2
 )-	  &	
 
 AHHHHHH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>r`      sR    "   / / - C 8(-8H-?:;]Ho{BC8Hr   