
    O3jP                    D   d dl mZ d dlmZ d dlmZ d dlmZmZm	Z	m
Z
mZ d dlmZmZmZmZmZmZ d dlmZ d dlmZ d dlmZmZmZmZmZmZmZmZm Z m!Z!m"Z" d d	l#m$Z$m%Z%m&Z& d d
l'm(Z(m)Z) d dl*m+Z+ erRd dl,m-Z-m.Z. d dl/m0Z0m1Z1 d dlmZm2Z2 d dl3m4Z4 d dlmZm5Z5m6Z6 d dl7m8Z8 d dl9m:Z: d dl#m;Z;m<Z<m=Z= d dl>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZF g dZG G d de      ZH G d deeeef         ZI G d deIeef   eeef         ZJ G d deJeef   eeef         ZK G d deKee f   eee f         ZL G d  d!eJee"f   eee"f         ZM G d" d#e$e   ee         ZN G d$ d%eNe   e	e         ZO G d& d'eNe!   e	e!         ZP G d( d)eOe   ee   e	e         ZQ G d* d+eOe   ee   e	e         ZR G d, d-eOe   ee   e	e         ZS G d. d/eNe   ee   ee         ZT G d0 d1eOe   eTe   e	e         ZU G d2 d3ePe!   eTe!   e	e!         ZV G d4 d5eOe   ee   e	e         ZW G d6 d7eOe   ee   e	e         ZXy8)9    )annotations)partial)methodcaller)TYPE_CHECKINGAnyGenericLiteralProtocol)CatNamespaceDateTimeNamespaceListNamespaceNameNamespaceStringNamespaceStructNamespace)CompliantColumn)CompliantNamespace)	AliasName
AliasNamesCompliantExprT_coCompliantFrameTCompliantLazyFrameTCompliantSeriesOrNativeExprT_coEagerDataFrameT
EagerExprTEagerSeriesT	LazyExprTNativeExprT)_StoresCompliantnot_implementedqualified_type_name)is_numpy_arrayis_numpy_scalar)MultiOutputExpressionError)CallableSequence)SelfTypeIs)r   EagerNamespace)CompliantSeries)r   	EvalNames
EvalSeries)ExprMetadata)	NoDefault)ImplementationVersion_LimitedContext)ClosedIntervalFillNullStrategy	IntoDTypeModeKeepStrategyNonNestedLiteral
RankMethodRollingInterpolationMethodTimeUnit)CompliantExprDepthTrackingExpr	EagerExprLazyExpr
NativeExprc                  H    e Zd ZdZd
dZddZddZddZddZddZ	ddZ
y	)r=   a	  An `Expr`-like object from a package with [Lazy-only support](https://narwhals-dev.github.io/narwhals/extending/#levels-of-support).

    Protocol members are chosen *purely* for matching statically - as they
    are common to all currently supported packages.
    c                     y N )selfargskwdss      E/DATA/.local/lib/python3.12/site-packages/narwhals/_compliant/expr.pybetweenzNativeExpr.betweenB   s    s    c                    y r@   rA   rB   values     rE   __gt__zNativeExpr.__gt__H       SrG   c                    y r@   rA   rI   s     rE   __lt__zNativeExpr.__lt__I   rL   rG   c                    y r@   rA   rI   s     rE   __ge__zNativeExpr.__ge__J   rL   rG   c                    y r@   rA   rI   s     rE   __le__zNativeExpr.__le__K   rL   rG   c                    y r@   rA   rI   s     rE   __eq__zNativeExpr.__eq__L   rL   rG   c                    y r@   rA   rI   s     rE   __ne__zNativeExpr.__ne__M   rL   rG   N)rC   r   rD   r   returnr   )rJ   r   rW   r&   )__name__
__module____qualname____doc__rF   rK   rN   rP   rR   rT   rV   rA   rG   rE   r=   r=   ;   s      ; 100000rG   r=   c                     e Zd ZU ded<   ded<   ded<   dZded	<   ed*d
       Z	 	 	 	 d+dZd,dZd-dZ	e
	 	 	 	 	 	 d.d       Ze
	 	 	 	 	 	 d/d       Zd,dZd,dZd0dZd,dZd,dZd1dZd,dZd,dZd,dZd,dZd,dZd,dZd2d3dZd2d3dZd,dZd,dZd4d Zd4d!Zd,d"Zd,d#Z d,d$Z!d5d%Z"	 	 	 	 	 	 d6d&Z#	 	 	 	 	 	 	 	 d7d'Z$	 	 	 	 	 	 	 	 	 	 d8d(Z%ed9d)       Z&y):r9   r.   _implementationEvalNames[CompliantFrameT]_evaluate_output_namesAliasNames | None_alias_output_namesNzExprMetadata | None_opt_metadatac                L    | j                   d}t        |      | j                   S )Na3  `_opt_metadata` is None. This is usually the result of trying to do some operation (such as `over`) which requires access to the metadata at the compliant level. You may want to consider rewriting your logic so that this operation is not necessary. Ideally you should avoid setting `_opt_metadata` manually.)rb   AssertionError)rB   msgs     rE   	_metadatazCompliantExpr._metadata[   s1    %4  !%%!!!rG   c                     y r@   rA   rB   dfs     rE   __call__zCompliantExpr.__call__h   s    47rG   c                    | S r@   rA   rB   s    rE   __narwhals_expr__zCompliantExpr.__narwhals_expr__k   s    rG   c                     y r@   rA   rl   s    rE   __narwhals_namespace__z$CompliantExpr.__narwhals_namespace__n   s    SVrG   c                    y r@   rA   )clscontextcolumn_indicess      rE   from_column_indicesz!CompliantExpr.from_column_indiceso   s     rG   c                   y r@   rA   rq   evaluate_column_namesrr   s      rE   from_column_nameszCompliantExpr.from_column_namess        rG   c                     y r@   rA   rl   s    rE   	broadcastzCompliantExpr.broadcast{   s    rG   c                h    | j                         }| |j                  dd       j                         z   S )Ng        )ro   litr{   )rB   plxs     rE   _is_close_float_promotez%CompliantExpr._is_close_float_promote|   s1     ))+cggc4(22444rG   c                     y r@   rA   rB   names     rE   aliaszCompliantExpr.alias   s    rG   c                     y r@   rA   rl   s    rE   allzCompliantExpr.all       3rG   c                     y r@   rA   rl   s    rE   anyzCompliantExpr.any   r   rG   c                    y r@   rA   rB   ignore_nullss     rE   	any_valuezCompliantExpr.any_value   s    rG   c                     y r@   rA   rl   s    rE   countzCompliantExpr.count   s    SrG   c                     y r@   rA   rl   s    rE   minzCompliantExpr.min   r   rG   c                     y r@   rA   rl   s    rE   maxzCompliantExpr.max   r   rG   c                     y r@   rA   rl   s    rE   meanzCompliantExpr.mean       CrG   c                     y r@   rA   rl   s    rE   sumzCompliantExpr.sum   r   rG   c                     y r@   rA   rl   s    rE   medianzCompliantExpr.median   s    crG   c                     y r@   rA   rB   order_bys     rE   firstzCompliantExpr.first   s    3rG   c                     y r@   rA   r   s     rE   lastzCompliantExpr.last   s    #rG   c                     y r@   rA   rl   s    rE   skewzCompliantExpr.skew   r   rG   c                     y r@   rA   rl   s    rE   kurtosiszCompliantExpr.kurtosis       rG   c                    y r@   rA   rB   ddofs     rE   stdzCompliantExpr.std       rG   c                    y r@   rA   r   s     rE   varzCompliantExpr.var   r   rG   c                     y r@   rA   rl   s    rE   n_uniquezCompliantExpr.n_unique   r   rG   c                     y r@   rA   rl   s    rE   
null_countzCompliantExpr.null_count   s    #rG   c                     y r@   rA   rl   s    rE   lenzCompliantExpr.len   r   rG   c                     y r@   rA   )rB   partition_byr   s      rE   overzCompliantExpr.over   s    RUrG   c                     y r@   rA   rB   quantileinterpolations      rE   r   zCompliantExpr.quantile   s    rG   c                    y r@   rA   )rB   functionreturn_dtypereturns_scalars       rE   map_batcheszCompliantExpr.map_batches   s     rG   c                    y r@   rA   rB   defaultoldnewr   s        rE   replace_strictzCompliantExpr.replace_strict   ry   rG   c                     y r@   rA   rl   s    rE   r   zCompliantExpr.name   s    +.rG   )rW   r,   )ri   r   rW   z)Sequence[CompliantSeriesOrNativeExprT_co]rW   r&   )rW   z)CompliantNamespace[CompliantFrameT, Self])rs   intrr   r0   rW   r&   )rw   r^   rr   r0   rW   r&   r   strrW   r&   r   boolrW   r&   rA   r   Sequence[str]rW   r&   r   r   rW   r&   )r   r   r   r   rW   r&   r   floatr   r7   rW   r&   )r   z9Callable[[CompliantSeries[Any]], CompliantExpr[Any, Any]]r   IntoDType | Noner   r   rW   r&   
r   zSelf | NoDefaultr   Sequence[Any]r   r   r   r   rW   r&   )rW   zNameNamespace[Self])'rX   rY   rZ   __annotations__rb   propertyrf   rj   rm   ro   classmethodrt   rx   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   rA   rG   rE   r9   r9   P   s    $#66** *.M&-
" 
"8!8	28 W!,;	  9
 ! 
  %5 ,; !>=#,,#%U.H	K '
  
!  	 ' 
 . .rG   r9   c                  &    e Zd Zedd       ZddZy)ImplExprc                    d fd}|S )Nc                L    | j                   }D cg c]  }||   	 c}S c c}w r@   )columns)ri   column_namesiindicess      rE   fnz(ImplExpr._eval_names_indices.<locals>.fn   s(    ::L-45WLOW555s   !)ri   r   rW   r   rA   )r   r   s   ` rE   _eval_names_indiceszImplExpr._eval_names_indices   s    	6 	rG   c               T    | j                  |      }| j                  x}r ||      S |S r@   )r_   ra   )rB   framenamesr   s       rE   _evaluate_aliaseszImplExpr._evaluate_aliases   s3     ++E2)-)A)A A AuU|MMrG   N)r   zSequence[int]rW   r^   )r   r   rW   r   )rX   rY   rZ   staticmethodr   r   rA   rG   rE   r   r      s      NrG   r   c                  6    e Zd Ze	 	 	 	 	 	 	 	 dd       ZddZy)r:   c                   y r@   rA   rv   s      rE   rx   z#DepthTrackingExpr.from_column_names   ry   rG   c                `    t        t        | j                  j                                     dk  S )at  Check if expr is elementary.

        Examples:
            - nw.col('a').mean()  # depth 1
            - nw.mean('a')  # depth 1
            - nw.len()  # depth 0

        as opposed to, say

            - nw.col('a').filter(nw.col('b')>nw.col('c')).max()

        Elementary expressions are the only ones supported properly in
        pandas, PyArrow, and Dask.
           )r   listrf   op_nodes_reversedrl   s    rE   _is_elementaryz DepthTrackingExpr._is_elementary   s&     488:;<AArG   N)rq   z
type[Self]rw   r^   rr   r0   rW   r&   )rW   r   )rX   rY   rZ   r   rx   r   rA   rG   rE   r:   r:      s@     9
 ! 
 BrG   r:   c                     e Zd ZU ded<   	 	 	 	 	 	 	 	 	 	 	 	 dudZdvdZ	 	 dwdZe	 	 	 	 	 	 	 	 	 	 dxd       Zedyd       Z	dzdZ
d	d
	 	 	 	 	 	 	 d{dZd	d
	 	 	 d|dZed}d       Z	 	 	 	 	 	 	 	 	 	 d~dZ	 	 	 	 	 	 	 	 ddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZdd Z dd!Z!dd"Z"dd#Z#dd$Z$dd%Z%dd&Z&dd'Z'dd(Z(dd)Z)dd*Z*dd+Z+dd,Z,dd-Z-dd.Z.dd/Z/dd0Z0dd1Z1dd2Z2dd3Z3dd4Z4dd5Z5dd6Z6dd7Z7dd8Z8dd9Z9dd:Z:dd;Z;dd<Z<dd=Z=dd>Z>dd?Z?	 	 	 	 	 	 	 	 dd@Z@ddAZAddBZBddCZCddDZD	 	 	 	 	 	 	 	 	 	 ddEZEddFZFddGZGddHZHddIZI	 	 	 	 	 	 	 	 	 	 ddJZJddKZKddLZLddMZMddNZN	 	 	 	 	 	 ddOZOddPZPddQZQddRZRddSZSddTZTddUZUddVZVddWZWddXZXddYZY	 	 	 	 	 	 	 	 	 	 ddZZZdd[Z[	 	 	 	 	 	 	 	 	 	 dd\Z\	 	 	 	 	 	 	 	 dd]Z]dd^Z^dd_Z_dd`Z`ddaZaddbZbddcZcdddZdddeZeddfZfddgZgddhZhddiZi	 	 	 	 	 	 	 	 ddjZjdddkZkdddlZlddmZmenddn       Zoenddo       Zpenddp       Zqenddq       Zrenddr       Zsendds       Ztyt)r;   )EvalSeries[EagerDataFrameT, EagerSeriesT]_callc                    y r@   rA   )rB   callevaluate_output_namesalias_output_namesimplementationversions         rE   __init__zEagerExpr.__init__   s     rG   c                $    | j                  |      S r@   )r   rh   s     rE   rj   zEagerExpr.__call__   s    zz"~rG   c                     y r@   rA   rl   s    rE   ro   z EagerExpr.__narwhals_namespace__   s    HKrG   c               D     | ||||j                   |j                        S )Nr   r   r   r   r]   _version)rq   funcr   r   rr   s        rE   _from_callablezEagerExpr._from_callable   s,     "71"22$$
 	
rG   c                R     | fdfdd j                   j                        S )Nc                
    gS r@   rA   _dfseriess    rE   <lambda>z(EagerExpr._from_series.<locals>.<lambda>  s    rG   c                    j                   gS r@   r   r  s    rE   r  z(EagerExpr._from_series.<locals>.<lambda>  s    v{{mrG   r   r   )rq   r  s    `rE   _from_serieszEagerExpr._from_series  s)     ";#!11OO
 	
rG   c                     j                   d nfdnfdd fd} j                  | j                   j                   j                        S )Nc                F     |       D cg c]
  } |       c}S c c}w r@   rA   )output_namesx
alias_namecurrent_alias_output_namess     rE   r  z4EagerExpr._with_alias_output_names.<locals>.<lambda>  s)    +El+S&+SaJqM+S& &s   c                :    | D cg c]
  } |       c}S c c}w r@   rA   )r
  r  r  s     rE   r  z4EagerExpr._with_alias_output_names.<locals>.<lambda>#  s    |'L|!
1|'L'L   c                @   rKt         |        j                  |             d      D cg c]  \  }}|j                  |       c}}S t         |       j                  |       d      D cg c]  \  }}|j                  |       c}}S c c}}w c c}}w )NTstrict)zipr_   r   )ri   r  r   r   rB   s      rE   r   z0EagerExpr._with_alias_output_names.<locals>.func&  s    ! ),R*4+F+Fr+JK#)) LL&)  %(Hd99"=d%%LFD T"% s   B5Br   ri   r   rW   zlist[EagerSeriesT])ra   	__class__r_   r]   r   )rB   r  r   r   r  s   `` @@rE   _with_alias_output_namesz"EagerExpr._with_alias_output_names  sp    %)%=%=" !  *5	
 M 		" ~~"&"="=1//MM  
 	
rG   Fr   c                   t        | j                  f||d|}| j                  || j                  | j                  |       S )a  Reuse Series implementation for expression.

        If Series.foo is already defined, and we'd like Expr.foo to be the same, we can
        leverage this method to do that for us.

        Arguments:
            method_name: name of method.
            returns_scalar: whether the Series version returns a scalar. In this case,
                the expression version should return a 1-row Series.
            kwargs: keyword arguments to pass to function.
        )method_namer   r   r   rr   )r   _reuse_series_innerr   r_   ra   )rB   r  r   kwargsr   s        rE   _reuse_serieszEagerExpr._reuse_series?  s^     $$
#)
 	
 """&"="=#77	 # 
 	
rG   c                   i S r@   rA   )rB   r   s     rE   _reuse_series_extra_kwargsz$EagerExpr._reuse_series_extra_kwargs\  s	     	rG   c                    t        |d      S )Nrm   )hasattr)rq   objs     rE   _is_exprzEagerExpr._is_expra  s    s/00rG   c                  |j                         D ci c]*  \  }}|| j                  |      r|j                  |      n|, }}}t        |fi | j	                  |      |} | |      D cg c]#  }|r|j                   ||            n ||      % }	}| j                  |      d |	D        }}
t        d t        |
|d      D              rd|
 d}t        |      |	S c c}}w c c}w )Nr  c              3  4   K   | ]  }|j                     y wr@   r  ).0ss     rE   	<genexpr>z0EagerExpr._reuse_series_inner.<locals>.<genexpr>|  s     5Jcaffc   c              3  ,   K   | ]  \  }}||k7    y wr@   rA   )r&  r   r   s      rE   r(  z0EagerExpr._reuse_series_inner.<locals>.<genexpr>}  s      
-MkeTETM-Ms   Tr  ztSafety assertion failed, please report a bug to https://github.com/narwhals-dev/narwhals/issues
Expression aliases: 
)
itemsr#  _evaluate_single_output_exprr   r  _from_scalarr   r   r  rd   )rB   ri   r  r   r  r   rJ   methodr  outaliasesr   re   s                rE   r  zEagerExpr._reuse_series_innere  s2     &||~	
  .e }}U# 11%8  .	 	 
 
--^-L
 
 r('
" 4BFv/vf~U" 	 '
 //35Jc5J 
-0%-M
 
''.ir3  !%%
1
'
s   /C#.(C)c                n     d fd} j                  | j                   j                         S )a  Reuse Series implementation for expression.

        Just like `_reuse_series`, but for e.g. `Expr.dt.foo` instead
        of `Expr.foo`.

        Arguments:
            series_namespace: The Series namespace.
            method_name: name of method, within `series_namespace`.
            expressifiable_args: keyword arguments to pass to function, which may
                be expressifiable (e.g. `nw.col('a').str.replace('abc', nw.col('b')))`).
        c           
        j                         D ci c]*  \  }}|j                  |      r| j                  |      n|, }}} |       D cg c]  } t        t        |            di |  c}S c c}}w c c}w )NrA   )r,  r#  r-  getattr)	ri   r   rJ   r  r  expressifiable_argsr  rB   series_namespaces	        rE   innerz0EagerExpr._reuse_series_namespace.<locals>.inner  s    
 $7#<#<#>	 $?KD% ==' 55e< $?	   #2h&F H(89;GQ&Q& s   /A7#A=r  r  r   r_   ra   )rB   r6  r  r5  r7  s   ```` rE   _reuse_series_namespacez!EagerExpr._reuse_series_namespace  s?    $
	 
	 """&"="=#77	 # 
 	
rG   c                     d fd} t               | j                   j                   j                   j                        S )Nc                V    g } |       D ]  }d|_         |j                  |        |S )NT)
_broadcastappend)ri   resultsresultrB   s      rE   r   z!EagerExpr.broadcast.<locals>.func  s1    Gr($(!v& # NrG   r   r  )typer_   ra   r]   r   rB   r   s   ` rE   r{   zEagerExpr.broadcast  sB    	 tDz"&"="=#77//MM
 	
rG   c                (    | j                  d|      S )Ncast)dtyper  )rB   rD  s     rE   rC  zEagerExpr.cast  s    !!&!66rG   c               (    | j                  ||      S )NotherrE  rB   operatorrH  s      rE   _with_binaryzEagerExpr._with_binary  s    !!(%!88rG   c               F    | j                  d      j                  ||      S )NliteralrG  )r   r  rI  s      rE   _with_binary_rightzEagerExpr._with_binary_right  s!    zz)$22852IIrG   c                &    | j                  d|      S )NrT   rK  rB   rH  s     rE   rT   zEagerExpr.__eq__        511rG   c                &    | j                  d|      S )NrV   rP  rQ  s     rE   rV   zEagerExpr.__ne__  rR  rG   c                &    | j                  d|      S )NrP   rP  rQ  s     rE   rP   zEagerExpr.__ge__  rR  rG   c                &    | j                  d|      S )NrK   rP  rQ  s     rE   rK   zEagerExpr.__gt__  rR  rG   c                &    | j                  d|      S )NrR   rP  rQ  s     rE   rR   zEagerExpr.__le__  rR  rG   c                &    | j                  d|      S )NrN   rP  rQ  s     rE   rN   zEagerExpr.__lt__  rR  rG   c                &    | j                  d|      S )N__and__rP  rQ  s     rE   rY  zEagerExpr.__and__        E22rG   c                &    | j                  d|      S )N__or__rP  rQ  s     rE   r\  zEagerExpr.__or__  rR  rG   c                &    | j                  d|      S )N__add__rP  rQ  s     rE   r^  zEagerExpr.__add__  rZ  rG   c                &    | j                  d|      S )N__sub__rP  rQ  s     rE   r`  zEagerExpr.__sub__  rZ  rG   c                &    | j                  d|      S )N__rsub__rN  rQ  s     rE   rb  zEagerExpr.__rsub__      &&z599rG   c                &    | j                  d|      S )N__mul__rP  rQ  s     rE   rf  zEagerExpr.__mul__  rZ  rG   c                &    | j                  d|      S )N__truediv__rP  rQ  s     rE   rh  zEagerExpr.__truediv__  s      66rG   c                &    | j                  d|      S )N__rtruediv__rc  rQ  s     rE   rj  zEagerExpr.__rtruediv__  s    &&~u==rG   c                &    | j                  d|      S )N__floordiv__rP  rQ  s     rE   rl  zEagerExpr.__floordiv__  s      77rG   c                &    | j                  d|      S )N__rfloordiv__rc  rQ  s     rE   rn  zEagerExpr.__rfloordiv__  s    &&>>rG   c                &    | j                  d|      S )N__pow__rP  rQ  s     rE   rp  zEagerExpr.__pow__  rZ  rG   c                &    | j                  d|      S )N__rpow__rc  rQ  s     rE   rr  zEagerExpr.__rpow__  rd  rG   c                &    | j                  d|      S )N__mod__rP  rQ  s     rE   rt  zEagerExpr.__mod__  rZ  rG   c                &    | j                  d|      S )N__rmod__rc  rQ  s     rE   rv  zEagerExpr.__rmod__  rd  rG   c                $    | j                  d      S )N
__invert__rE  rl   s    rE   rx  zEagerExpr.__invert__      !!,//rG   c                $    | j                  d      S )N__neg__rE  rl   s    rE   r{  zEagerExpr.__neg__      !!),,rG   c                (    | j                  dd      S )Nr   Tr  rE  rl   s    rE   r   zEagerExpr.null_count  s    !!,t!DDrG   c                (    | j                  dd      S )Nr   Tr  rE  rl   s    rE   r   zEagerExpr.n_unique      !!*T!BBrG   c                (    | j                  dd      S )Nr   Tr  rE  rl   s    rE   r   zEagerExpr.sum      !!%!==rG   c                (    | j                  dd      S )Nr   Tr  rE  rl   s    rE   r   zEagerExpr.count  s    !!'$!??rG   c                (    | j                  dd      S )Nr   Tr  rE  rl   s    rE   r   zEagerExpr.mean      !!&!>>rG   c                (    | j                  dd      S )Nr   Tr  rE  rl   s    rE   r   zEagerExpr.median  s    !!(4!@@rG   c               *    | j                  dd|      S )Nr   Tr   r   rE  r   s     rE   r   zEagerExpr.std      !!%4!HHrG   c               *    | j                  dd|      S )Nr   Tr  rE  r   s     rE   r   zEagerExpr.var!  r  rG   c                (    | j                  dd      S )Nr   Tr  rE  rl   s    rE   r   zEagerExpr.skew$  r  rG   c                (    | j                  dd      S )Nr   Tr  rE  rl   s    rE   r   zEagerExpr.kurtosis'  r  rG   c                (    | j                  dd      S )Nr   Tr  rE  rl   s    rE   r   zEagerExpr.any*  r  rG   c                (    | j                  dd      S )Nr   Tr  rE  rl   s    rE   r   zEagerExpr.all-  r  rG   c                (    | j                  dd      S )Nr   Tr  rE  rl   s    rE   r   zEagerExpr.max0  r  rG   c                (    | j                  dd      S )Nr   Tr  rE  rl   s    rE   r   zEagerExpr.min3  r  rG   c                (    | j                  dd      S )Narg_minTr  rE  rl   s    rE   r  zEagerExpr.arg_min6      !!)D!AArG   c                (    | j                  dd      S )Narg_maxTr  rE  rl   s    rE   r  zEagerExpr.arg_max9  r  rG   c                *    | j                  d||      S )Nclip)lower_boundupper_boundrE  )rB   r  r  s      rE   r  zEagerExpr.clip>  s!    !! " 
 	
rG   c                (    | j                  d|      S )N
clip_lower)r  rE  )rB   r  s     rE   r  zEagerExpr.clip_lowerC      !!,K!HHrG   c                (    | j                  d|      S )N
clip_upper)r  rE  )rB   r  s     rE   r  zEagerExpr.clip_upperF  r  rG   c                $    | j                  d      S )Nis_nullrE  rl   s    rE   r  zEagerExpr.is_nullI  r|  rG   c                $    | j                  d      S )Nis_nanrE  rl   s    rE   r  zEagerExpr.is_nanL  s    !!(++rG   c                (    | j                  d|      S )Nfill_nan)rJ   rE  rI   s     rE   r  zEagerExpr.fill_nanO  s    !!*E!::rG   c                ,    | j                  d|||      S )N	fill_null)rJ   strategylimitrE  )rB   rJ   r  r  s       rE   r  zEagerExpr.fill_nullR  s%     !!uxu " 
 	
rG   c                (    | j                  d|      S )Nis_inrG  rE  rQ  s     rE   r  zEagerExpr.is_inY  s    !!'!77rG   c                $    | j                  d      S )Narg_truerE  rl   s    rE   r  zEagerExpr.arg_true\  s    !!*--rG   c                l    | j                         } |j                  |ddi}| j                  d|      S )Nr   Ffilter)	predicate)ro   all_horizontalr  )rB   
predicatesr~   r  s       rE   r  zEagerExpr.filter_  s=    ))+&C&&
GG	!!(i!@@rG   c                $    | j                  d      S )N
drop_nullsrE  rl   s    rE   r  zEagerExpr.drop_nullsd  ry  rG   c               .    | j                  d||||      S )Nr   )r   r   r   r   rE  r   s        rE   r   zEagerExpr.replace_strictg  s'     !!#3l " 
 	
rG   c               *    | j                  d||      S )Nsort
descending
nulls_lastrE  rB   r  r  s      rE   r  zEagerExpr.sorts  s    !!&ZJ!WWrG   c                $    | j                  d      S )NabsrE  rl   s    rE   r  zEagerExpr.absv      !!%((rG   c                (    | j                  dd      S )NuniqueF)maintain_orderrE  rl   s    rE   r  zEagerExpr.uniquey  s    !!(5!AArG   c                $    | j                  d      S )NdiffrE  rl   s    rE   r  zEagerExpr.diff|      !!&))rG   c               .    | j                  d||||      S )Nsample)nfractionwith_replacementseedrE  )rB   r  r  r  r  s        rE   r  zEagerExpr.sample  s)     !!H?OVZ " 
 	
rG   c                     dfd} t                fd j                  | j                   j                        S )Nc                F    t        |       dk7  rd|  }t        |      gS N   z:Expected function with single output, found output names: )r   r#   r   re   r   s     rE   r   z+EagerExpr.alias.<locals>.alias_output_names  s.    5zQRSXRYZ0556MrG   c                X     |       D cg c]  }|j                         c}S c c}w r@   r   )ri   r  r   rB   s     rE   r  z!EagerExpr.alias.<locals>.<lambda>  s$    bBvT*BBs   'r   r   r   rW   r   )r@  r_   r]   r   )rB   r   r   s   `` rE   r   zEagerExpr.alias  s<    	 tDzB"&"="=1//MM
 	
rG   c                $    | j                  d      S )N	is_uniquerE  rl   s    rE   r  zEagerExpr.is_unique      !!+..rG   c                $    | j                  d      S )Nis_first_distinctrE  rl   s    rE   r  zEagerExpr.is_first_distinct  s    !!"566rG   c                $    | j                  d      S )Nis_last_distinctrE  rl   s    rE   r  zEagerExpr.is_last_distinct  s    !!"455rG   c                ,    | j                  dd||      S )Nr   T)r   r   r   rE  r   s      rE   r   zEagerExpr.quantile  s(     !!'	 " 
 	
rG   c                (    | j                  d|      S )Nheadr  rE  rB   r  s     rE   r  zEagerExpr.head      !!&A!..rG   c                (    | j                  d|      S )Ntailr  rE  r  s     rE   r  zEagerExpr.tail  r  rG   c                (    | j                  d|      S )Nround)decimalsrE  )rB   r  s     rE   r  zEagerExpr.round  s    !!'H!==rG   c                $    | j                  d      S )NfloorrE  rl   s    rE   r  zEagerExpr.floor  s    !!'**rG   c                $    | j                  d      S )NceilrE  rl   s    rE   r  zEagerExpr.ceil  r  rG   c                (    | j                  dd      S )Nr   Tr  rE  rl   s    rE   r   zEagerExpr.len  r  rG   c                *    | j                  d||      S )Ngather_every)r  offsetrE  )rB   r  r  s      rE   r  zEagerExpr.gather_every  s    !!.Af!EErG   c               (    | j                  d|      S )Nmode)keeprE  )rB   r  s     rE   r  zEagerExpr.mode  s    !!&t!44rG   c                $    | j                  d      S )N	is_finiterE  rl   s    rE   r  zEagerExpr.is_finite  r  rG   c               ,    | j                  d|||      S )Nrolling_meanwindow_sizemin_samplescenterrE  rB   r  r  r  s       rE   r  zEagerExpr.rolling_mean  s&    !!##	 " 
 	
rG   c               .    | j                  d||||      S )Nrolling_stdr  r  r  r   rE  rB   r  r  r  r   s        rE   r  zEagerExpr.rolling_std  +     !!## " 
 	
rG   c               ,    | j                  d|||      S )Nrolling_sumr  rE  r  s       rE   r  zEagerExpr.rolling_sum  s$    !!{TZ " 
 	
rG   c               .    | j                  d||||      S )Nrolling_varr  rE  r  s        rE   r  zEagerExpr.rolling_var  r  rG   c               n     d fd} j                  | j                   j                         S )Nc                    |       }d |D        }t        fd|D              }|d   |d   }}t        ||d      }t        |      st        |      r,t	        |j
                        t        fd|D              }nIt        ||j                        rt        d |D              }n |j                  t        fd	|D              }t        fd
|D              }t        d |D              }sRt        |      rGt        |       dkD  r9|j                  d      }	t        ||	         }
dt        |
       d}t        |      |S )Nc              3  4   K   | ]  }|j                     y wr@   r  )r&  input_seriess     rE   r(  z6EagerExpr.map_batches.<locals>.func.<locals>.<genexpr>  s     P-,L---r)  c              3  .   K   | ]  } |        y wr@   rA   )r&  r  r   s     rE   r(  z6EagerExpr.map_batches.<locals>.func.<locals>.<genexpr>  s     "P-8F#3-s   r   Tr  )rr   c              3  R   K   | ]  \  }} |      j                  |         y wr@   r  )r&  arrout_name
from_numpys      rE   r(  z6EagerExpr.map_batches.<locals>.func.<locals>.<genexpr>  s'     WTV=3z#44X>TV   $'c              3  D   K   | ]  \  }}|j                  |        y wr@   r  )r&  r  r  s      rE   r(  z6EagerExpr.map_batches.<locals>.func.<locals>.<genexpr>  s     Qb:J&(v||H5bs    c              3  R   K   | ]  \  }} |      j                  |         y wr@   r  )r&  valr  from_scalars      rE   r(  z6EagerExpr.map_batches.<locals>.func.<locals>.<genexpr>  s(     XUWMC{3/55h?UWr	  c              3  @   K   | ]  }|j                          y wr@   )rC  )r&  r  r   s     rE   r(  z6EagerExpr.map_batches.<locals>.func.<locals>.<genexpr>  s     NvVv{{<8vs   c              3  8   K   | ]  }t        |      d k(    yw)r  N)r   )r&  rs     rE   r(  z6EagerExpr.map_batches.<locals>.func.<locals>.<genexpr>  s     $A&QSVq[&s   r  zG`map_batches` with `returns_scalar=False` must return a Series; found 'zQ'.

If `returns_scalar` is set to `True`, a returned value can be a scalar value.)tupler  r!   r"   r   r  
isinstancer  r.  r   r   indexr@  r    	TypeError)ri   udf_series_inr
  udf_series_out	_first_in
_first_outitr?  is_scalar_result_idx_typere   r  r  r   r   r   rB   s               @@rE   r   z#EagerExpr.map_batches.<locals>.func  sD    HMP-PL""P-"PPN$1!$4nQ6GzI ^\$?Bj)_Z-H$Y%9%94H
WTVWWJ	(;(;<QbQQ'44XUWXX'NvNN$$A&$AA",<(=3r7Q;'--d3^D121%89 :PP 
  n$MrG   r  ri   r   rW   Sequence[EagerSeriesT]r8  )rB   r   r   r   r   s   ```` rE   r   zEagerExpr.map_batches  s@    	 	@ """&"="=#77	 # 
 	
rG   c                (    | j                  d|      S )Nshiftr  rE  r  s     rE   r   zEagerExpr.shift  s    !!'Q!//rG   c               (    | j                  d|      S )Ncum_sumreverserE  rB   r$  s     rE   r"  zEagerExpr.cum_sum      !!)W!==rG   c               (    | j                  d|      S )N	cum_countr#  rE  r%  s     rE   r(  zEagerExpr.cum_count  s    !!+w!??rG   c               (    | j                  d|      S )Ncum_minr#  rE  r%  s     rE   r*  zEagerExpr.cum_min"  r&  rG   c               (    | j                  d|      S )Ncum_maxr#  rE  r%  s     rE   r,  zEagerExpr.cum_max%  r&  rG   c               (    | j                  d|      S )Ncum_prodr#  rE  r%  s     rE   r.  zEagerExpr.cum_prod(  s    !!*g!>>rG   c               *    | j                  d||      S )Nrank)r/  r  rE  )rB   r/  r  s      rE   r0  zEagerExpr.rank+  s    !!&J!OOrG   c                (    | j                  d|      S )Nlog)baserE  )rB   r3  s     rE   r2  zEagerExpr.log.  s    !!%d!33rG   c                $    | j                  d      S )NexprE  rl   s    rE   r5  zEagerExpr.exp1  r  rG   c                $    | j                  d      S )NsinrE  rl   s    rE   r7  zEagerExpr.sin4  r  rG   c                $    | j                  d      S )NcosrE  rl   s    rE   r9  zEagerExpr.cos7  r  rG   c                $    | j                  d      S )NsqrtrE  rl   s    rE   r;  zEagerExpr.sqrt:  r  rG   c                ,    | j                  d|||      S )N
is_between)r  r  closedrE  )rB   r  r  r>  s       rE   r=  zEagerExpr.is_between=  s&     !!k{SY " 
 	
rG   c                     s j                  dd      S d fd} j                  | j                   j                         S )Nr   Tr  c                V     | j                   ddd}  j                         |       S NFr  )r  r   ri   r   rB   s    rE   r   zEagerExpr.first.<locals>.funcH  s*    (uGB4::<##rG   r  ri   r   rW   r   r  r   r_   ra   rB   r   r   s   `` rE   r   zEagerExpr.firstD  sS    %%gd%CC	$ """&"="=#77	 # 
 	
rG   c                     s j                  dd      S d fd} j                  | j                   j                         S )Nr   Tr  c                V     | j                   ddd}  j                         |       S rA  )r  r   rB  s    rE   r   zEagerExpr.last.<locals>.funcW  s)    (uGB499;r?"rG   r  rC  rD  rE  s   `` rE   r   zEagerExpr.lastS  sS    %%fT%BB	# """&"="=#77	 # 
 	
rG   c               *    | j                  dd|      S )Nr   T)r   r   rE  r   s     rE   r   zEagerExpr.any_valueb  s!    !!< " 
 	
rG   c                    t        |       S r@   )EagerExprCatNamespacerl   s    rE   catzEagerExpr.catg      $T**rG   c                    t        |       S r@   )EagerExprDateTimeNamespacerl   s    rE   dtzEagerExpr.dtk  s    )$//rG   c                    t        |       S r@   )EagerExprListNamespacerl   s    rE   r   zEagerExpr.listo      %d++rG   c                    t        |       S r@   )EagerExprNameNamespacerl   s    rE   r   zEagerExpr.names  rR  rG   c                    t        |       S r@   )EagerExprStringNamespacerl   s    rE   r   zEagerExpr.strw      '--rG   c                    t        |       S r@   )EagerExprStructNamespacerl   s    rE   structzEagerExpr.struct{  rW  rG   N)r   r   r   EvalNames[EagerDataFrameT]r   r`   r   r.   r   r/   rW   Noner  )rW   z=EagerNamespace[EagerDataFrameT, EagerSeriesT, Self, Any, Any])
r   r   r   r[  r   r`   rr   r0   rW   r&   )r  r   rW   r&   )r  AliasName | NonerW   r&   )r  r   r   r   r  r   rW   r&   )r   r   rW   zdict[str, Any])r"  z
Self | AnyrW   zTypeIs[Self])
ri   r   r  r   r   r   r  r   rW   r  )r6  z5Literal['cat', 'dt', 'list', 'name', 'str', 'struct']r  r   r5  r   rW   r&   r   )rD  r3   rW   r&   )rJ  r   rH  r&   rW   r&   )rH  r&   rW   r&   r   )r  r&   r  r&   rW   r&   )r  r&   rW   r&   )r  r&   rW   r&   )rJ   float | NonerW   r&   )rJ   zSelf | Noner  zFillNullStrategy | Noner  
int | NonerW   r&   )rH  r   rW   r&   )r  r&   rW   r&   r   )r  r   r  r   rW   r&   )
r  r_  r  r^  r  r   r  r_  rW   r&   r   r   )r  r   rW   r&   )r  r   rW   r&   )r  r   r  r   rW   r&   )r  r4   rW   r&   )r  r   r  r   r  r   rW   r&   )
r  r   r  r   r  r   r   r   rW   r&   )r   zCallable[[Any], Any]r   r   r   r   rW   r&   )r$  r   rW   r&   )r/  r6   r  r   rW   r&   )r3  r   rW   r&   )r  r&   r  r&   r>  r1   rW   r&   r   r   r   )rW   zEagerExprCatNamespace[Self])rW   z EagerExprDateTimeNamespace[Self])rW   zEagerExprListNamespace[Self])rW   zEagerExprNameNamespace[Self])rW   zEagerExprStringNamespace[Self])rW   zEagerExprStructNamespace[Self])urX   rY   rZ   r   r   rj   ro   r   r   r  r  r  r  r#  r  r9  r{   rC  rK  rN  rT   rV   rP   rK   rR   rN   rY  r\  r^  r`  rb  rf  rh  rj  rl  rn  rp  rr  rt  rv  rx  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  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.  r0  r2  r5  r7  r9  r;  r=  r   r   r   r   rK  rO  r   r   r   rZ  rA   rG   rE   r;   r;      s    547  :	
 . '  
L	FL 
7
  :	

 .
 !
 

 
  
 
%
P ;@

37
KN
	
< ).!%	
 1 1   	 
     
  D#
O#
 #
  #	#

 
#
J
&79J2222223233:37>8?3:3:0-EC>@?AII?C>>>>BB


II-,;
 
,C
LV
	
8.A
0

!

 

 	

 '

 


X)B*



 	


 

 

 



/76

.H
	
//>+*>F5/
	
	
03	
=A	
IL	
		


	
	
03	
=A	
IL	
		
,
&,
 ',

 ,
 
,
\0>@>>?P4)))*

.2
<J
	




 + + 0 0 , , , , . . . .rG   r;   c                  d    e Zd ZU ddZddZed	d       Z e       Z e       Z	 e       Z
ded<   y)
r<   c                    y r@   rA   rA  s     rE   r  z!LazyExpr._with_alias_output_names  s    CrG   c                2    dfd}| j                  |      S )Nc                F    t        |       dk7  rd|  }t        |      gS r  )r   
ValueErrorr  s     rE   r   zLazyExpr.alias.<locals>.fn  s-    5zQRSXRYZ o%6MrG   r  )r  )rB   r   r   s    ` rE   r   zLazyExpr.alias  s    	 ,,R00rG   c                    t        |       S r@   )LazyExprNameNamespacerl   s    rE   r   zLazyExpr.name  rL  rG   r   rK  N)r   r`   rW   r&   r   )rW   zLazyExprNameNamespace[Self])rX   rY   rZ   r  r   r   r   r   ewm_meanr   rK  r   rA   rG   rE   r<   r<     s@     P1 + +  H!#K*,C,rG   r<   c                  *    e Zd ZU ded<   edd       Zy)_ExprNamespacer   _compliant_exprc                    | j                   S r@   rj  rl   s    rE   	compliantz_ExprNamespace.compliant  s    ###rG   NrW   r   )rX   rY   rZ   r   r   rm  rA   rG   rE   ri  ri    s     '&$ $rG   ri  c                      e Zd ZddZy)EagerExprNamespacec                   || _         y r@   rl  rB   exprs     rE   r   zEagerExprNamespace.__init__  
    #rG   N)rs  r   rW   r\  rX   rY   rZ   r   rA   rG   rE   rp  rp        $rG   rp  c                      e Zd ZddZy)LazyExprNamespacec                   || _         y r@   rl  rr  s     rE   r   zLazyExprNamespace.__init__  rt  rG   N)rs  r   rW   r\  ru  rA   rG   rE   rx  rx    rv  rG   rx  c                      e Zd ZddZy)rJ  c                :    | j                   j                  dd      S )NrK  get_categoriesrm  r9  rl   s    rE   r|  z$EagerExprCatNamespace.get_categories  s    ~~55e=MNNrG   NrW   r   )rX   rY   rZ   r|  rA   rG   rE   rJ  rJ    s    OrG   rJ  c                      e Z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Z
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ZddZddZddZddZddZddZy) rN  c                >    | j                   j                  dd|      S )NrO  	to_stringformatr}  rB   r  s     rE   r  z$EagerExprDateTimeNamespace.to_string  s    ~~55dKPV5WWrG   c                >    | j                   j                  dd|      S )NrO  replace_time_zone	time_zoner}  rB   r  s     rE   r  z,EagerExprDateTimeNamespace.replace_time_zone  &    ~~55% 6 
 	
rG   c                >    | j                   j                  dd|      S )NrO  convert_time_zoner  r}  r  s     rE   r  z,EagerExprDateTimeNamespace.convert_time_zone  r  rG   c                >    | j                   j                  dd|      S )NrO  	timestamp)	time_unitr}  )rB   r  s     rE   r  z$EagerExprDateTimeNamespace.timestamp  s%    ~~55+ 6 
 	
rG   c                :    | j                   j                  dd      S )NrO  dater}  rl   s    rE   r  zEagerExprDateTimeNamespace.date      ~~55dFCCrG   c                :    | j                   j                  dd      S )NrO  yearr}  rl   s    rE   r  zEagerExprDateTimeNamespace.year  r  rG   c                :    | j                   j                  dd      S )NrO  monthr}  rl   s    rE   r  z EagerExprDateTimeNamespace.month  s    ~~55dGDDrG   c                :    | j                   j                  dd      S )NrO  dayr}  rl   s    rE   r  zEagerExprDateTimeNamespace.day  s    ~~55dEBBrG   c                :    | j                   j                  dd      S )NrO  hourr}  rl   s    rE   r  zEagerExprDateTimeNamespace.hour  r  rG   c                :    | j                   j                  dd      S )NrO  minuter}  rl   s    rE   r  z!EagerExprDateTimeNamespace.minute      ~~55dHEErG   c                :    | j                   j                  dd      S )NrO  secondr}  rl   s    rE   r  z!EagerExprDateTimeNamespace.second  r  rG   c                :    | j                   j                  dd      S )NrO  millisecondr}  rl   s    rE   r  z&EagerExprDateTimeNamespace.millisecond      ~~55dMJJrG   c                :    | j                   j                  dd      S )NrO  microsecondr}  rl   s    rE   r  z&EagerExprDateTimeNamespace.microsecond  r  rG   c                :    | j                   j                  dd      S )NrO  
nanosecondr}  rl   s    rE   r  z%EagerExprDateTimeNamespace.nanosecond  s    ~~55dLIIrG   c                :    | j                   j                  dd      S )NrO  ordinal_dayr}  rl   s    rE   r  z&EagerExprDateTimeNamespace.ordinal_day  r  rG   c                :    | j                   j                  dd      S )NrO  weekdayr}  rl   s    rE   r  z"EagerExprDateTimeNamespace.weekday  s    ~~55dIFFrG   c                :    | j                   j                  dd      S )NrO  total_minutesr}  rl   s    rE   r  z(EagerExprDateTimeNamespace.total_minutes      ~~55dOLLrG   c                :    | j                   j                  dd      S )NrO  total_secondsr}  rl   s    rE   r  z(EagerExprDateTimeNamespace.total_seconds  r  rG   c                :    | j                   j                  dd      S )NrO  total_millisecondsr}  rl   s    rE   r  z-EagerExprDateTimeNamespace.total_milliseconds      ~~55d<PQQrG   c                :    | j                   j                  dd      S )NrO  total_microsecondsr}  rl   s    rE   r  z-EagerExprDateTimeNamespace.total_microseconds  r  rG   c                :    | j                   j                  dd      S )NrO  total_nanosecondsr}  rl   s    rE   r  z,EagerExprDateTimeNamespace.total_nanoseconds  s    ~~55d<OPPrG   c                >    | j                   j                  dd|      S )NrO  truncate)everyr}  )rB   r  s     rE   r  z#EagerExprDateTimeNamespace.truncate  s    ~~55dJe5TTrG   c                >    | j                   j                  dd|      S )NrO  	offset_bybyr}  rB   r  s     rE   r  z$EagerExprDateTimeNamespace.offset_by  s    ~~55dKB5OOrG   N)r  r   rW   r   )r  
str | NonerW   r   )r  r   rW   r   )r  r8   rW   r   r~  )r  r   rW   r   r  r   rW   r   )rX   rY   rZ   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rA   rG   rE   rN  rN    s    X





DDECDFFKKJKGMMRRQUPrG   rN  c                  \    e Z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Z
dd	Zdd
Zy)rQ  c                :    | j                   j                  dd      S )Nr   r   r}  rl   s    rE   r   zEagerExprListNamespace.len      ~~55feDDrG   c                :    | j                   j                  dd      S )Nr   r  r}  rl   s    rE   r  zEagerExprListNamespace.unique      ~~55fhGGrG   c                >    | j                   j                  dd|      S )Nr   contains)itemr}  )rB   r  s     rE   r  zEagerExprListNamespace.contains
  s    ~~55fjt5TTrG   c                >    | j                   j                  dd|      S )Nr   get)r  r}  )rB   r  s     rE   r  zEagerExprListNamespace.get  s    ~~55fe55QQrG   c                :    | j                   j                  dd      S )Nr   r   r}  rl   s    rE   r   zEagerExprListNamespace.min  r  rG   c                :    | j                   j                  dd      S )Nr   r   r}  rl   s    rE   r   zEagerExprListNamespace.max  r  rG   c                :    | j                   j                  dd      S )Nr   r   r}  rl   s    rE   r   zEagerExprListNamespace.mean  s    ~~55ffEErG   c                :    | j                   j                  dd      S )Nr   r   r}  rl   s    rE   r   zEagerExprListNamespace.median  r  rG   c                :    | j                   j                  dd      S )Nr   r   r}  rl   s    rE   r   zEagerExprListNamespace.sum  r  rG   c               @    | j                   j                  dd||      S )Nr   r  r  r}  r  s      rE   r  zEagerExprListNamespace.sort  s'    ~~55Fzj 6 
 	
rG   Nr~  )r  r5   rW   r   )r  r   rW   r   )r  r   r  r   rW   r   )rX   rY   rZ   r   r  r  r  r   r   r   r   r   r  rA   rG   rE   rQ  rQ    s=    EHUREEFHE
rG   rQ  c                  V    e Zd Zd
dZddZddZddZd
dZd
dZe	dd       Z
ddZy	)CompliantExprNameNamespacec                $    | j                  d       S r@   r   rl   s    rE   r  zCompliantExprNameNamespace.keep*  s    ""4((rG   c                $    | j                  |      S r@   r  )rB   r   s     rE   mapzCompliantExprNameNamespace.map-  s    ""8,,rG   c                ,    | j                  fd      S )Nc                     |  S r@   rA   )r   prefixs    rE   r  z3CompliantExprNameNamespace.prefix.<locals>.<lambda>1  s    6(4&0ArG   r  rB   r  s    `rE   r  z!CompliantExprNameNamespace.prefix0      ""#ABBrG   c                ,    | j                  fd      S )Nc                    |   S r@   rA   )r   suffixs    rE   r  z3CompliantExprNameNamespace.suffix.<locals>.<lambda>4  s    4&0ArG   r  rB   r  s    `rE   r  z!CompliantExprNameNamespace.suffix3  r  rG   c                @    | j                  t        j                        S r@   )r   r   lowerrl   s    rE   to_lowercasez'CompliantExprNameNamespace.to_lowercase6      ""399--rG   c                @    | j                  t        j                        S r@   )r   r   upperrl   s    rE   to_uppercasez'CompliantExprNameNamespace.to_uppercase9  r  rG   c                    d fd}|S )Nc               :    | D cg c]
  } |       c}S c c}w r@   rA   )r
  r   r   s     rE   r   z:CompliantExprNameNamespace._alias_output_names.<locals>.fn>  s    +78<4DJ<888r  )r
  r   rW   r   rA   )r   r   s   ` rE   ra   z.CompliantExprNameNamespace._alias_output_names<  s    	9 	rG   c                    y r@   rA   rA  s     rE   r   z)CompliantExprNameNamespace._from_callableC  s    crG   Nrn  )r   r   rW   r   )r  r   rW   r   )r  r   rW   r   )r   r   rW   r   )r   r]  rW   r   )rX   rY   rZ   r  r  r  r  r  r  r   ra   r   rA   rG   rE   r  r  %  s<    
)-CC..   RrG   r  c                      e Zd ZddZy)rT  c                <    | j                   }|j                  |      S r@   )rm  r  )rB   r   rs  s      rE   r   z%EagerExprNameNamespace._from_callableK  s    ~~,,T22rG   N)r   r]  rW   r   rX   rY   rZ   r   rA   rG   rE   rT  rT  F  s    
3rG   rT  c                      e Zd ZddZy)rf  c                f    | j                   }|r| j                  |      nd }|j                  |      S r@   )rm  ra   r  )rB   r   rs  r
  s       rE   r   z$LazyExprNameNamespace._from_callableU  s0    ~~9=t//54,,\::rG   N)r   r]  rW   r   r  rA   rG   rE   rf  rf  P  s    
;rG   rf  c                      e Z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Z
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dd dZy)!rV  c                :    | j                   j                  dd      S )Nr   	len_charsr}  rl   s    rE   r  z"EagerExprStringNamespace.len_chars^  s    ~~55e[IIrG   c               D    | j                   j                  dd||||      S )Nr   replace)patternrJ   rM  r  r}  )rB   rJ   r  rM  r  s        rE   r  z EagerExprStringNamespace.replacea  s-     ~~559gUGq 6 
 	
rG   c               B    | j                   j                  dd|||      S )Nr   replace_all)r  rJ   rM  r}  )rB   rJ   r  rM  s       rE   r  z$EagerExprStringNamespace.replace_allh  s+     ~~55=' 6 
 	
rG   c                >    | j                   j                  dd|      S )Nr   strip_chars)
charactersr}  )rB   r  s     rE   r  z$EagerExprStringNamespace.strip_charso  s%    ~~55=Z 6 
 	
rG   c                >    | j                   j                  dd|      S )Nr   starts_with)r  r}  r  s     rE   r  z$EagerExprStringNamespace.starts_witht      ~~55e]SY5ZZrG   c                >    | j                   j                  dd|      S )Nr   	ends_with)r  r}  r  s     rE   r  z"EagerExprStringNamespace.ends_withw  s    ~~55e[QW5XXrG   c               @    | j                   j                  dd||      S )Nr   r  )r  rM  r}  )rB   r  rM  s      rE   r  z!EagerExprStringNamespace.containsz  s'    ~~55:w 6 
 	
rG   c                @    | j                   j                  dd||      S )Nr   slice)r  lengthr}  )rB   r  r  s      rE   r  zEagerExprStringNamespace.slice  s'    ~~5576& 6 
 	
rG   c                >    | j                   j                  dd|      S )Nr   splitr  r}  r  s     rE   r  zEagerExprStringNamespace.split  s    ~~55eW5LLrG   c                >    | j                   j                  dd|      S )Nr   to_datetimer  r}  r  s     rE   r  z$EagerExprStringNamespace.to_datetime  r  rG   c                >    | j                   j                  dd|      S )Nr   to_dater  r}  r  s     rE   r  z EagerExprStringNamespace.to_date      ~~55eYv5VVrG   c                >    | j                   j                  dd|      S )Nr   to_timer  r}  r  s     rE   r  z EagerExprStringNamespace.to_time  r	  rG   c                :    | j                   j                  dd      S )Nr   r  r}  rl   s    rE   r  z%EagerExprStringNamespace.to_lowercase      ~~55e^LLrG   c                :    | j                   j                  dd      S )Nr   r  r}  rl   s    rE   r  z%EagerExprStringNamespace.to_uppercase  r  rG   c                >    | j                   j                  dd|      S )Nr   zfill)widthr}  )rB   r  s     rE   r  zEagerExprStringNamespace.zfill  s    ~~55eWE5RRrG   c                :    | j                   j                  dd      S )Nr   to_titlecaser}  rl   s    rE   r  z%EagerExprStringNamespace.to_titlecase  r  rG   c                @    | j                   j                  dd||      S )Nr   	pad_startr  	fill_charr}  rB   r  r  s      rE   r  z"EagerExprStringNamespace.pad_start  s'    ~~55;v 6 
 	
rG   c                @    | j                   j                  dd||      S )Nr   pad_endr  r}  r  s      rE   r  z EagerExprStringNamespace.pad_end  s'    ~~559Vy 6 
 	
rG   Nr~  )
rJ   r   r  r   rM  r   r  r   rW   r   )rJ   r   r  r   rM  r   rW   r   )r  r  rW   r   )r  r   rW   r   )r  r   rW   r   )r  r   rM  r   rW   r   )r  r   r  r_  rW   r   r  )r  r  rW   r   )r  r   rW   r   ) )r  r   r  r   rW   r   )rX   rY   rZ   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rA   rG   rE   rV  rV  [  s    J

*-
;?
DG
	


*-
;?
	


[Y



M[WWMMSM


rG   rV  c                      e Zd ZddZy)rY  c                \    | j                   j                  dd|      j                  |      S )NrZ  fieldr  )rm  r9  r   r   s     rE   r  zEagerExprStructNamespace.field  s.    ~~55hd5SYY
 	
rG   N)r   r   rW   r   )rX   rY   rZ   r  rA   rG   rE   rY  rY    s    
rG   rY  N)Y
__future__r   	functoolsr   rJ  r   typingr   r   r   r	   r
   !narwhals._compliant.any_namespacer   r   r   r   r   r   narwhals._compliant.columnr   narwhals._compliant.namespacer   narwhals._compliant.typingr   r   r   r   r   r   r   r   r   r   r   narwhals._utilsr   r   r    narwhals.dependenciesr!   r"   narwhals.exceptionsr#   collections.abcr$   r%   typing_extensionsr&   r'   r(   narwhals._compliant.seriesr)   r*   r+   narwhals._expression_parsingr,   narwhals._typingr-   r.   r/   r0   narwhals.typingr1   r2   r3   r4   r5   r6   r7   r8   __all__r=   r9   r   r:   r;   r<   ri  rp  rx  rJ  rN  rQ  r  rT  rf  rV  rY  rA   rG   rE   <module>r0     s   "  ! A A  7 <    S R A :2.P:LL9*HH	 	 	 X1 1*[/Xo/NNO[/|N/#BBC_==>N("B_==>_==>"BJV
.o|34_l*+V
.t- +-.9Lk9Y0Z-,$&'2C)D$$
3WZ5H $
$y1793E $
Oz"L$<gj>QOLPz"$5j$A7:CVLP^!
z"M*$=wz?R!
HR$%#$RB3z"z*J3;i y)I;I
z"OJ$?ATI
X
z"OJ$?AT
rG   