o
    Lh
                  	   @  s   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 de
eeef eeeeef ZdS )    )annotationsN)reduce)TYPE_CHECKINGAnyProtocol)LazyNamespace)NativeExprTNativeFrameT_co)SQLExprTSQLLazyFrameT)Iterable)PythonLiteralc                   @  st   e Zd Zd%ddZd&ddZ	d'd(ddZd)ddZd*ddZd*ddZd+ddZ	d+dd Z
d+d!d"Zd+d#d$ZdS ),SQLNamespacenamestrargsNativeExprT | PythonLiteralreturnr   c                 G     d S N )selfr   r   r   r   X/var/www/html/Persson_Maskin/env/lib/python3.10/site-packages/narwhals/_sql/namespace.py	_function       zSQLNamespace._functionvaluer   c                 C  r   r   r   )r   r   r   r   r   _lit   r   zSQLNamespace._litN	condition	otherwiseNativeExprT | Nonec                 C  r   r   r   )r   r   r   r   r   r   r   _when   s   zSQLNamespace._whenexprsc                 G  r   r   r   )r   r!   r   r   r   	_coalesce   r   zSQLNamespace._coalescer
   ignore_nullsboolc                  $   d fdd}j j|g|R  S )NcolsIterable[NativeExprT]r   r   c                   "    rfdd| D } t tj| S )Nc                 3  "    | ]}  | d V  qdS )FNr"   r   .0colr   r   r   	<genexpr>#        z<SQLNamespace.any_horizontal.<locals>.func.<locals>.<genexpr>)r   operatoror_r&   r#   r   r   r   func!      z)SQLNamespace.any_horizontal.<locals>.funcr&   r'   r   r   _expr_from_elementwise_horizontal_opr   r#   r!   r5   r   r4   r   any_horizontal       zSQLNamespace.any_horizontalc                  r%   )Nr&   r'   r   r   c                   r(   )Nc                 3  r)   )TNr*   r+   r.   r   r   r/   +   r0   z<SQLNamespace.all_horizontal.<locals>.func.<locals>.<genexpr>)r   r1   and_r3   r4   r   r   r5   )   r6   z)SQLNamespace.all_horizontal.<locals>.funcr7   r8   r;   r   r4   r   all_horizontal(   r=   zSQLNamespace.all_horizontalc                   "   d fdd} j j|g|R  S )Nr&   r'   r   r   c                       j dg| R  S )Ngreatestr   r3   r.   r   r   r5   1      z)SQLNamespace.max_horizontal.<locals>.funcr7   r8   r   r!   r5   r   r.   r   max_horizontal0      zSQLNamespace.max_horizontalc                   r@   )Nr&   r'   r   r   c                   rA   )NleastrC   r3   r.   r   r   r5   7   rD   z)SQLNamespace.min_horizontal.<locals>.funcr7   r8   rE   r   r.   r   min_horizontal6   rG   zSQLNamespace.min_horizontalc                   r@   )Nr&   r'   r   r   c                   s   t tj fdd| D S )Nc                 3  r)   )r   Nr*   r+   r.   r   r   r/   ?   r0   z<SQLNamespace.sum_horizontal.<locals>.func.<locals>.<genexpr>)r   r1   addr3   r.   r   r   r5   =   s   z)SQLNamespace.sum_horizontal.<locals>.funcr7   r8   rE   r   r.   r   sum_horizontal<   s   zSQLNamespace.sum_horizontalc                   r@   )Nr&   r'   r   r   c                   s
    j |  S r   )r"   r3   r.   r   r   r5   F   s   
z#SQLNamespace.coalesce.<locals>.funcr7   r8   rE   r   r.   r   coalesceE   rG   zSQLNamespace.coalesce)r   r   r   r   r   r   )r   r   r   r   r   )r   r   r   r   r   r   r   r   )r!   r   r   r   )r!   r
   r#   r$   r   r
   )r!   r
   r   r
   )__name__
__module____qualname__r   r   r    r"   r<   r?   rF   rI   rK   rL   r   r   r   r   r      s    







	r   )
__future__r   r1   	functoolsr   typingr   r   r   narwhals._compliantr   narwhals._compliant.typingr   r	   narwhals._sql.typingr
   r   collections.abcr   narwhals.typingr   r   r   r   r   r   <module>   s    
