
    -PhH                    R   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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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& d d	l'm(Z(m)Z) d d
l*m+Z+m,Z, erPd dlmZ d dl-m.Z.m/Z/ d dlmZm0Z0 d dl1m2Z2 d dlmZm3Z3m4Z4m5Z5m6Z6 d dl7m8Z8m9Z9 d dl'm:Z:m;Z;m<Z< d dl=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZE g dZF G d de          ZG G d de%eef                   ZH G d deHeef         e%eef                   ZI G d deIee!f         e%ee!f                   ZJ G d deHee#f         e%ee#f                   ZK G d de(e         ee                   ZL G d  d!eLe          e
e                    ZM G d" d#eLe"         e
e"                   ZN G d$ d%eMe          ee          e
e                    ZO G d& d'eMe          ee          e
e                    ZP G d( d)eMe          ee          e
e                    ZQ G d* d+eLe         ee         ee                   ZR G d, d-eMe          eRe          e
e                    ZS G d. d/eNe"         eRe"         e
e"                   ZT G d0 d1eMe          ee          e
e                    ZU G d2 d3eMe          ee          e
e                    ZVd4S )5    )annotations)partial)methodcaller)TYPE_CHECKINGAnyCallableGenericLiteralMappingProtocolSequence)CatNamespaceDateTimeNamespaceListNamespaceNameNamespaceStringNamespaceStructNamespace)CompliantNamespace)	AliasName
AliasNamesCompliantExprT_coCompliantFrameTCompliantLazyFrameTCompliantSeriesOrNativeExprT_coEagerDataFrameT
EagerExprTEagerSeriesT	LazyExprTNativeExprT)
Protocol38
deprecated)_StoresCompliantnot_implemented)	get_numpyis_numpy_array)r   )SelfTypeIs)r   EagerNamespace)CompliantSeries)r   	EvalNames
EvalSeriesScalarKwargsWindowFunction)ExprKindExprMetadata)ImplementationVersion_FullContext)FillNullStrategy	IntoDTypeNonNestedLiteralNumericLiteral
RankMethodRollingInterpolationMethodTemporalLiteralTimeUnit)CompliantExpr	EagerExprLazyExpr
NativeExprc                  "    e Zd ZdZd	dZd	dZdS )
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.
    argsr   kwdsreturnc                    d S N selfr@   rA   s      X/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/narwhals/_compliant/expr.pybetweenzNativeExpr.betweenO             c                    d S rD   rE   rF   s      rH   isinzNativeExpr.isinP   rJ   rK   N)r@   r   rA   r   rB   r   )__name__
__module____qualname____doc__rI   rM   rE   rK   rH   r>   r>   H   s4          ;:::777777rK   r>   c                     e Zd ZU ded<   ded<   ded<   ded<   d	ed
<   ded<   ddZddZddZedd            Zedd            Z	e
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Zdd1Zdd2Zdd3Zdd4Zdd6Zdd7Zdd8Zdd9Zdd:Z ddAZ!ddBZ"ddCZ#ddDZ$ddEZ%ddHZ&ddJZ'ddKZ(ddMZ)ddNZ*ddOZ+ddPZ,ddQZ-ddRZ.ddSZ/ddTZ0ddWZ1ddXZ2ddYZ3ddZZ4dd[Z5dd^Z6ddaZ7dddZ8ddkZ9ddoZ:ddtZ;ddxZ<dd{Z=ddZ>ddZ?ddZ@ddZAddZBddZC eDd          dd            ZEddZFddZGddZHddZIddZJddZKddZLddZMddZNddZOddZPddZQddZRddZSddZTddZUddZVeWdd            ZXeWdd            ZYeWdd            ZZeWdd            Z[eWdd            Z\eWdd            Z]dS )r;   r0   _implementationtuple[int, ...]_backend_versionr1   _versionEvalNames[CompliantFrameT]_evaluate_output_namesAliasNames | None_alias_output_nameszExprMetadata | None	_metadatadfr   rB   )Sequence[CompliantSeriesOrNativeExprT_co]c                    d S rD   rE   rG   r\   s     rH   __call__zCompliantExpr.__call__[   s    47CrK   Nonec                    d S rD   rE   rG   s    rH   __narwhals_expr__zCompliantExpr.__narwhals_expr__^   rJ   rK   )CompliantNamespace[CompliantFrameT, Self]c                    d S rD   rE   rc   s    rH   __narwhals_namespace__z$CompliantExpr.__narwhals_namespace___   rJ   rK   evaluate_column_namescontextr2   r&   c                  d S rD   rE   )clsrh   ri   s      rH   from_column_nameszCompliantExpr.from_column_names`   	     srK   column_indicesintc                   d S rD   rE   )rk   ri   rn   s      rH   from_column_indicesz!CompliantExpr.from_column_indicesh   s    WZWZrK   indicesSequence[int]c                    d fd}|S )Nr\   r   rB   Sequence[str]c                0    | j         fdD             S )Nc                     g | ]
}|         S rE   rE   ).0icolumn_namess     rH   
<listcomp>zACompliantExpr._eval_names_indices.<locals>.fn.<locals>.<listcomp>n   s    555LO555rK   )columns)r\   rz   rr   s    @rH   fnz-CompliantExpr._eval_names_indices.<locals>.fnl   s%    :L5555W5555rK   )r\   r   rB   ru   rE   )rr   r}   s   ` rH   _eval_names_indicesz!CompliantExpr._eval_names_indicesj   s(    	6 	6 	6 	6 	6 	6 	rK   c                    d S rD   rE   rc   s    rH   is_nullzCompliantExpr.is_nullr   rJ   rK   c                    d S rD   rE   rc   s    rH   abszCompliantExpr.abss   rJ   rK   c                    d S rD   rE   rc   s    rH   allzCompliantExpr.allt   rJ   rK   c                    d S rD   rE   rc   s    rH   anyzCompliantExpr.anyu   rJ   rK   namestrc                    d S rD   rE   rG   r   s     rH   aliaszCompliantExpr.aliasv   rJ   rK   dtyper4   c                    d S rD   rE   rG   r   s     rH   castzCompliantExpr.castw   rJ   rK   c                    d S rD   rE   rc   s    rH   countzCompliantExpr.countx   rJ   rK   c                    d S rD   rE   rc   s    rH   minzCompliantExpr.miny   rJ   rK   c                    d S rD   rE   rc   s    rH   maxzCompliantExpr.maxz   rJ   rK   c                    d S rD   rE   rc   s    rH   arg_minzCompliantExpr.arg_min{   rJ   rK   c                    d S rD   rE   rc   s    rH   arg_maxzCompliantExpr.arg_max|   rJ   rK   c                    d S rD   rE   rc   s    rH   arg_truezCompliantExpr.arg_true}   rJ   rK   c                    d S rD   rE   rc   s    rH   meanzCompliantExpr.mean~   rJ   rK   c                    d S rD   rE   rc   s    rH   sumzCompliantExpr.sum   rJ   rK   c                    d S rD   rE   rc   s    rH   medianzCompliantExpr.median   rJ   rK   c                    d S rD   rE   rc   s    rH   skewzCompliantExpr.skew   rJ   rK   ddofc                   d S rD   rE   rG   r   s     rH   stdzCompliantExpr.std   rJ   rK   c                   d S rD   rE   r   s     rH   varzCompliantExpr.var   rJ   rK   c                    d S rD   rE   rc   s    rH   n_uniquezCompliantExpr.n_unique   rJ   rK   c                    d S rD   rE   rc   s    rH   
null_countzCompliantExpr.null_count   rJ   rK   c                    d S rD   rE   rc   s    rH   
drop_nullszCompliantExpr.drop_nulls   rJ   rK   valueSelf | NonNestedLiteralstrategyFillNullStrategy | Nonelimit
int | Nonec                    d S rD   rE   rG   r   r   r   s       rH   	fill_nullzCompliantExpr.fill_null   s	    
 srK   c                    d S rD   rE   rc   s    rH   diffzCompliantExpr.diff   rJ   rK   c                    d S rD   rE   rc   s    rH   expzCompliantExpr.exp   rJ   rK   c                    d S rD   rE   rc   s    rH   uniquezCompliantExpr.unique   rJ   rK   c                    d S rD   rE   rc   s    rH   lenzCompliantExpr.len   rJ   rK   basefloatc                    d S rD   rE   )rG   r   s     rH   logzCompliantExpr.log   rJ   rK   decimalsc                    d S rD   rE   rG   r   s     rH   roundzCompliantExpr.round   rJ   rK   c                    d S rD   rE   rc   s    rH   modezCompliantExpr.mode   rJ   rK   nc                    d S rD   rE   rG   r   s     rH   headzCompliantExpr.head   rJ   rK   c                    d S rD   rE   r   s     rH   tailzCompliantExpr.tail   rJ   rK   c                    d S rD   rE   r   s     rH   shiftzCompliantExpr.shift   rJ   rK   c                    d S rD   rE   rc   s    rH   	is_finitezCompliantExpr.is_finite   rJ   rK   c                    d S rD   rE   rc   s    rH   is_nanzCompliantExpr.is_nan   rJ   rK   c                    d S rD   rE   rc   s    rH   	is_uniquezCompliantExpr.is_unique   rJ   rK   c                    d S rD   rE   rc   s    rH   is_first_distinctzCompliantExpr.is_first_distinct   rJ   rK   c                    d S rD   rE   rc   s    rH   is_last_distinctzCompliantExpr.is_last_distinct   rJ   rK   reverseboolc                   d S rD   rE   rG   r   s     rH   cum_sumzCompliantExpr.cum_sum   rJ   rK   c                   d S rD   rE   r   s     rH   	cum_countzCompliantExpr.cum_count   rJ   rK   c                   d S rD   rE   r   s     rH   cum_minzCompliantExpr.cum_min   rJ   rK   c                   d S rD   rE   r   s     rH   cum_maxzCompliantExpr.cum_max   rJ   rK   c                   d S rD   rE   r   s     rH   cum_prodzCompliantExpr.cum_prod   rJ   rK   otherr   c                    d S rD   rE   rG   r   s     rH   is_inzCompliantExpr.is_in   rJ   rK   
descending
nulls_lastc                   d S rD   rE   rG   r   r   s      rH   sortzCompliantExpr.sort   rJ   rK   methodr7   c                   d S rD   rE   )rG   r   r   s      rH   rankzCompliantExpr.rank   rJ   rK   old!Sequence[Any] | Mapping[Any, Any]newSequence[Any]return_dtypeIntoDType | Nonec                   d S rD   rE   rG   r   r   r   s       rH   replace_strictzCompliantExpr.replace_strict   s	     srK   partition_byru   order_byc                    d S rD   rE   )rG   r   r   s      rH   overzCompliantExpr.over   rJ   rK   fractionfloat | Nonewith_replacementseedc                   d S rD   rE   rG   r   r  r  r  s        rH   samplezCompliantExpr.sample   rm   rK   quantileinterpolationr8   c                    d S rD   rE   rG   r
  r  s      rH   r
  zCompliantExpr.quantile       srK   function9Callable[[CompliantSeries[Any]], CompliantExpr[Any, Any]]c                    d S rD   rE   )rG   r  r   s      rH   map_batcheszCompliantExpr.map_batches   	     srK   lower_bound.Self | NumericLiteral | TemporalLiteral | Noneupper_boundc                    d S rD   rE   rG   r  r  s      rH   clipzCompliantExpr.clip   r  rK   comspan	half_lifealphaadjustmin_samplesignore_nullsc                   d S rD   rE   )rG   r  r  r  r  r  r  r   s           rH   ewm_meanzCompliantExpr.ewm_mean   s	     srK   window_sizecenterc                   d S rD   rE   rG   r#  r  r$  s       rH   rolling_sumzCompliantExpr.rolling_sum   r  rK   c                   d S rD   rE   r&  s       rH   rolling_meanzCompliantExpr.rolling_mean   r  rK   c                   d S rD   rE   rG   r#  r  r$  r   s        rH   rolling_varzCompliantExpr.rolling_var   r  rK   c                   d S rD   rE   r+  s        rH   rolling_stdzCompliantExpr.rolling_std   r  rK   zSince `1.22.0`offsetc                    d S rD   rE   rG   r   r/  s      rH   gather_everyzCompliantExpr.gather_every   s    9<rK   c                    d S rD   rE   r   s     rH   __and__zCompliantExpr.__and__   rJ   rK   c                    d S rD   rE   r   s     rH   __or__zCompliantExpr.__or__   rJ   rK   c                    d S rD   rE   r   s     rH   __add__zCompliantExpr.__add__   rJ   rK   c                    d S rD   rE   r   s     rH   __sub__zCompliantExpr.__sub__   rJ   rK   c                    d S rD   rE   r   s     rH   __mul__zCompliantExpr.__mul__   rJ   rK   c                    d S rD   rE   r   s     rH   __floordiv__zCompliantExpr.__floordiv__   rJ   rK   c                    d S rD   rE   r   s     rH   __truediv__zCompliantExpr.__truediv__   rJ   rK   c                    d S rD   rE   r   s     rH   __mod__zCompliantExpr.__mod__   rJ   rK   c                    d S rD   rE   r   s     rH   __pow__zCompliantExpr.__pow__   rJ   rK   c                    d S rD   rE   r   s     rH   __gt__zCompliantExpr.__gt__   rJ   rK   c                    d S rD   rE   r   s     rH   __ge__zCompliantExpr.__ge__   rJ   rK   c                    d S rD   rE   r   s     rH   __lt__zCompliantExpr.__lt__   rJ   rK   c                    d S rD   rE   r   s     rH   __le__zCompliantExpr.__le__   rJ   rK   c                    d S rD   rE   rc   s    rH   
__invert__zCompliantExpr.__invert__   rJ   rK   kind/Literal[ExprKind.AGGREGATION, ExprKind.LITERAL]c                    d S rD   rE   )rG   rO  s     rH   	broadcastzCompliantExpr.broadcast   r  rK   c                P    | j         J | j         j                                        S )a	  Return `True` for multi-output aggregations without names.

        For example, column `'a'` only appears in the output as a grouping key:

            df.group_by('a').agg(nw.all().sum())

        It does not get included in:

            nw.all().sum().
        )r[   expansion_kindis_multi_unnamedrc   s    rH   _is_multi_output_unnamedz&CompliantExpr._is_multi_output_unnamed   s)     ~)))~,==???rK   rG   #CompliantExpr[CompliantFrameT, Any]framec               X    |                      |          }| j        x}r ||          n|S rD   )rX   rZ   )rG   rX  namesr   s       rH   _evaluate_aliaseszCompliantExpr._evaluate_aliases   s6     ++E22)-)A AMuuU|||MrK   c                    d S rD   rE   rc   s    rH   r   zCompliantExpr.str      #rK   c                    d S rD   rE   rc   s    rH   r   zCompliantExpr.name      3rK   c                    d S rD   rE   rc   s    rH   dtzCompliantExpr.dt
  s    rK   c                    d S rD   rE   rc   s    rH   catzCompliantExpr.cat  r]  rK   c                    d S rD   rE   rc   s    rH   listzCompliantExpr.list  r_  rK   c                    d S rD   rE   rc   s    rH   structzCompliantExpr.struct  s     SrK   N)r\   r   rB   r]   rB   ra   )rB   re   )rh   rW   ri   r2   rB   r&   )rn   ro   ri   r2   rB   r&   )rr   rs   rB   rW   rB   r&   r   r   rB   r&   r   r4   rB   r&   r   ro   rB   r&   r   r   r   r   r   r   rB   r&   )r   r   rB   r&   r   ro   rB   r&   r   ro   rB   r&   )r   r   rB   r&   r   r   rB   r&   r   r   r   r   rB   r&   )r   r7   r   r   rB   r&   r   r   r   r   r   r   rB   r&   )r   ru   r   ru   rB   r&   
r   r   r  r  r  r   r  r   rB   r&   r
  r   r  r8   rB   r&   )r  r  r   r   rB   r&   r  r  r  r  rB   r&   )r  r  r  r  r  r  r  r  r  r   r  ro   r   r   rB   r&   r#  ro   r  ro   r$  r   rB   r&   
r#  ro   r  ro   r$  r   r   ro   rB   r&   r   ro   r/  ro   rB   r&   rO  rP  rB   r&   rB   r   )rG   rW  rX  r   rB   ru   )rB   r   )^rN   rO   rP   __annotations__r`   rd   rg   classmethodrl   rq   staticmethodr~   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!   r2  r4  r6  r8  r:  r<  r>  r@  rB  rD  rF  rH  rJ  rL  rN  rR  rV  r[  propertyr   r   ra  rc  re  rg  rE   rK   rH   r;   r;   S   sq        ####%%%%6666****""""8 8 8 8 -,,,VVVV   [ ZZZ [Z   \ #"""++++1111    """"""""####!!!!,,,,,,,,####%%%%%%%%     !!!!++++////''''''''(((($$$$!!!!$$$$,,,,++++44446666444444445555,,,,FFFFHHHH    VUUU            
 
 
 
             Z !!<<< "!<....----............33332222........----------------%%%%   @ @ @ @N N N N  X X X X X    X   rK   r;   c                  R    e Zd ZU ded<   ded<   edddd            ZddZddZdS )DepthTrackingExprro   _depthr   _function_name )function_namerk   
type[Self]rh   rW   ri   r2   r  rB   r&   c                  d S rD   rE   )rk   rh   ri   r  s       rH   rl   z#DepthTrackingExpr.from_column_names  s	     srK   r   c                    | 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  rc   s    rH   _is_elementaryz DepthTrackingExpr._is_elementary%  s     {QrK   c                P    t          |           j         d| j         d| j         dS )Nz(depth=z, function_name=))typerN   r  r  rc   s    rH   __repr__zDepthTrackingExpr.__repr__6  s/    t**%aadkaa4K^aaaarK   N)
rk   r  rh   rW   ri   r2   r  r   rB   r&   rz  )rB   r   )rN   rO   rP   r{  r|  rl   r  r  rE   rK   rH   r  r    s          KKK       [   "b b b b b brK   r  c                  ~   e Zd ZU ded<   ded<   ddddZddZdd Zdd!Zedddd&            Z	edd)            Z
d*dd+dd1Zd*d2dd4Zedd8            Zdd9Zdd=Zdd@ZddCZddEZddFZddGZddHZddIZddJZddLZddMZddNZddOZddPZddQZddRZddSZddTZ ddUZ!ddVZ"ddWZ#ddXZ$ddYZ%ddZZ&dd[Z'dd\Z(dd]Z)dd^Z*dd_Z+dd`Z,ddbZ-ddcZ.dddZ/ddeZ0ddfZ1ddgZ2ddhZ3ddiZ4ddjZ5ddnZ6ddoZ7ddpZ8ddwZ9ddxZ:ddyZ;dd{Z<dd|Z=ddZ>ddZ?ddZ@ddZAddZBddZCddZDddZEddZFddZGddZHddZIddZJddZKddZLddZMddZNddZOddZPddZQddZRddZSddZTeUdd            ZVeUdd            ZWeUdd            ZXeUdd            ZYeUdd            ZZeUdd            Z[dS )r<   )EvalSeries[EagerDataFrameT, EagerSeriesT]_callr,   _scalar_kwargsN)scalar_kwargscalldepthro   r  r   evaluate_output_namesEvalNames[EagerDataFrameT]alias_output_namesrY   implementationr0   backend_versionrT   versionr1   r  ScalarKwargs | NonerB   ra   c                   d S rD   rE   )
rG   r  r  r  r  r  r  r  r  r  s
             rH   __init__zEagerExpr.__init__A  s	     srK   r\   r   Sequence[EagerSeriesT]c                ,    |                      |          S rD   )r  r_   s     rH   r`   zEagerExpr.__call__O  s    zz"~~rK   8EagerNamespace[EagerDataFrameT, EagerSeriesT, Self, Any]c                    d S rD   rE   rc   s    rH   rg   z EagerExpr.__narwhals_namespace__R  s    CF3rK   c                    d S rD   rE   rc   s    rH   rd   zEagerExpr.__narwhals_expr__U  rJ   rK   funcri   r2   r&   c               H     | ||||||j         |j        |j        |	  	        S )N)r  r  r  r  r  r  r  r  rS   rU   rV   )rk   r  r  r  r  r  ri   r  s           rH   _from_callablezEagerExpr._from_callableW  sA     s'"71"2#4$'

 

 

 
	
rK   seriesr   c           
     T     | fdddfdd j         j        j                  S )Nc                
    gS rD   rE   _dfr  s    rH   <lambda>z(EagerExpr._from_series.<locals>.<lambda>r  s	     rK   r   r  c                    j         gS rD   r   r  s    rH   r  z(EagerExpr._from_series.<locals>.<lambda>u  s    v{m rK   )r  r  r  r  r  r  r  r  )rk   r  s    `rH   _from_serieszEagerExpr._from_serieso  sN    s    "";";";";#!1"3O	
 	
 	
 		
rK   Freturns_scalarr  method_namer  r   expressifiable_argsr   c          	         t          | j        |||pi |          }|                     || j        dz   | j         d| | 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.
            scalar_kwargs: non-expressifiable args which we may need to reuse in `agg` or `over`,
                such as `ddof` for `std` and `var`.
            expressifiable_args: keyword arguments to pass to function, which may
                be expressifiable (e.g. `nw.col('a').is_between(3, nw.col('b')))`).
        )r  r  r  r     ->r  r  r  r  r  ri   )r   _reuse_series_innerr  r  r  rX   rZ   )rG   r  r  r  r  r  s         rH   _reuse_serieszEagerExpr._reuse_series|  s    , $#)'-2 3
 
 
 ""+/!0AAKAA"&"=#7' # 
 
 	
rK   r  dict[str, Any]c                   i S rD   rE   )rG   r  s     rH   _reuse_series_extra_kwargsz$EagerExpr._reuse_series_extra_kwargs  s	     	rK   obj
Self | AnyTypeIs[Self]c                "    t          |d          S Nrd   hasattrrk   r  s     rH   _is_exprzEagerExpr._is_expr      s/000rK   c               t   
 i | fd|                                 D             }t          |fi                                |

fd            D             }                               }d |D             t	          |          k    r!d| dd |D              }	t          |	          |S )Nc                p    i | ]2\  }}|                     |          r                    |          n|3S rE   )r  _evaluate_expr)rx   r   r   r\   rG   s      rH   
<dictcomp>z1EagerExpr._reuse_series_inner.<locals>.<dictcomp>  sS       D% $--2F2FQb''...E  rK   r  c                f    g | ]-}r|                      |                    n
 |          .S rE   )_from_scalar)rx   r  r   r  s     rH   r{   z1EagerExpr._reuse_series_inner.<locals>.<listcomp>  sR     '
 '
 '
 4BUFv///vvf~~'
 '
 '
rK   c                    g | ]	}|j         
S rE   r  rx   ss     rH   r{   z1EagerExpr._reuse_series_inner.<locals>.<listcomp>  s       qAF   rK   ztSafety assertion failed, please report a bug to https://github.com/narwhals-dev/narwhals/issues
Expression aliases: z
Series names: c                    g | ]	}|j         
S rE   r  r  s     rH   r{   z1EagerExpr._reuse_series_inner.<locals>.<listcomp>  s    !6!6!6Q!&!6!6!6rK   )itemsr   r  r[  re  AssertionError)rG   r\   r  r  r  r  kwargsoutaliasesmsgr   s   `` `      @rH   r  zEagerExpr._reuse_series_inner  s=   

    #6#<#<#>#>  
 
 
--^-LL
 
 

'
 '
 '
 '
 '
$r(('
 '
 '
 ((,,  C   DMM119'.9 9!6!6#!6!6!69 9 
 !%%%
rK   series_namespace5Literal['cat', 'dt', 'list', 'name', 'str', 'struct']r  c           	                                 fd j        dz    j         d d  j         j         j                   S )aY  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`.
            kwargs: keyword arguments to pass to function.
        c                6    fd |           D             S )Nc           	     X    g | ]&} t          t          |                    d i 'S )rE   )getattr)rx   r  r  r  r  s     rH   r{   zGEagerExpr._reuse_series_namespace.<locals>.<lambda>.<locals>.<listcomp>  sO        H(899;GGQQ&QQ  rK   rE   )r\   r  r  rG   r  s    rH   r  z3EagerExpr._reuse_series_namespace.<locals>.<lambda>  s=          "d2hh   rK   r  r  .r  )r  r  r  rX   rZ   r  )rG   r  r  r  s   ````rH   _reuse_series_namespacez!EagerExpr._reuse_series_namespace  s      ""       +/!0TT4DTT{TT"&"=#7- # 
 
 	
rK   rO  rP  c                     d fd} t                     | j         j         j         j         j         j         j         j        	  	        S )Nr\   r   rB   list[EagerSeriesT]c                `    g } |           D ]}d|_         |                    |           |S )NT)
_broadcastappend)r\   resultsresultrG   s      rH   r  z!EagerExpr.broadcast.<locals>.func  sA    G$r(( ' '$(!v&&&&NrK   r  r  r  r  r  r  r  r  )r\   r   rB   r  )	r  r  r  rX   rZ   rU   rS   rV   r  )rG   rO  r  s   `  rH   rR  zEagerExpr.broadcast  ss    	 	 	 	 	 	 tDzz+-"&"=#7 1/M-

 

 

 
	
rK   r   r4   c                0    |                      d|          S )Nr   )r   r  r   s     rH   r   zEagerExpr.cast  s    !!&!666rK   r   c                0    |                      d|          S )N__eq__r   r  r   s     rH   r  zEagerExpr.__eq__      !!(%!888rK   c                0    |                      d|          S )N__ne__r  r  r   s     rH   r  zEagerExpr.__ne__  r  rK   c                0    |                      d|          S )NrH  r  r  r   s     rH   rH  zEagerExpr.__ge__  r  rK   c                0    |                      d|          S )NrF  r  r  r   s     rH   rF  zEagerExpr.__gt__  r  rK   c                0    |                      d|          S )NrL  r  r  r   s     rH   rL  zEagerExpr.__le__  r  rK   c                0    |                      d|          S )NrJ  r  r  r   s     rH   rJ  zEagerExpr.__lt__  r  rK   Self | bool | Anyc                0    |                      d|          S )Nr4  r  r  r   s     rH   r4  zEagerExpr.__and__      !!)5!999rK   c                0    |                      d|          S )Nr6  r  r  r   s     rH   r6  zEagerExpr.__or__  r  rK   c                0    |                      d|          S )Nr8  r  r  r   s     rH   r8  zEagerExpr.__add__   r  rK   c                0    |                      d|          S )Nr:  r  r  r   s     rH   r:  zEagerExpr.__sub__#  r  rK   c                V    |                      d                              d|          S )Nliteral__rsub__r  r   r  r   s     rH   r  zEagerExpr.__rsub__&  '    zz)$$22:U2KKKrK   c                0    |                      d|          S )Nr<  r  r  r   s     rH   r<  zEagerExpr.__mul__)  r  rK   c                0    |                      d|          S )Nr@  r  r  r   s     rH   r@  zEagerExpr.__truediv__,  s    !!-u!===rK   c                V    |                      d                              d|          S )Nr  __rtruediv__r  r  r   s     rH   r  zEagerExpr.__rtruediv__/  s'    zz)$$22>2OOOrK   c                0    |                      d|          S )Nr>  r  r  r   s     rH   r>  zEagerExpr.__floordiv__2  s    !!.!>>>rK   c                V    |                      d                              d|          S )Nr  __rfloordiv__r  r  r   s     rH   r  zEagerExpr.__rfloordiv__5  s'    zz)$$22?%2PPPrK   c                0    |                      d|          S )NrD  r  r  r   s     rH   rD  zEagerExpr.__pow__8  r  rK   c                V    |                      d                              d|          S )Nr  __rpow__r  r  r   s     rH   r  zEagerExpr.__rpow__;  r  rK   c                0    |                      d|          S )NrB  r  r  r   s     rH   rB  zEagerExpr.__mod__>  r  rK   c                V    |                      d                              d|          S )Nr  __rmod__r  r  r   s     rH   r  zEagerExpr.__rmod__A  r  rK   c                ,    |                      d          S )NrN  r  rc   s    rH   rN  zEagerExpr.__invert__E      !!,///rK   c                0    |                      dd          S )Nr   Tr  r  rc   s    rH   r   zEagerExpr.null_countI  s    !!,t!DDDrK   c                0    |                      dd          S )Nr   Tr  r  rc   s    rH   r   zEagerExpr.n_uniqueL  s    !!*T!BBBrK   c                0    |                      dd          S )Nr   Tr  r  rc   s    rH   r   zEagerExpr.sumO      !!%!===rK   c                0    |                      dd          S )Nr   Tr  r  rc   s    rH   r   zEagerExpr.countR  s    !!'$!???rK   c                0    |                      dd          S )Nr   Tr  r  rc   s    rH   r   zEagerExpr.meanU      !!&!>>>rK   c                0    |                      dd          S )Nr   Tr  r  rc   s    rH   r   zEagerExpr.medianX  s    !!(4!@@@rK   r   c               6    |                      ddd|i          S )Nr   Tr   r  r  r   s     rH   r   zEagerExpr.std[  *    !!$vtn " 
 
 	
rK   c               6    |                      ddd|i          S )Nr   Tr   r  r  r   s     rH   r   zEagerExpr.var`  r  rK   c                0    |                      dd          S )Nr   Tr  r  rc   s    rH   r   zEagerExpr.skewe  r  rK   c                0    |                      dd          S )Nr   Tr  r  rc   s    rH   r   zEagerExpr.anyh  r  rK   c                0    |                      dd          S )Nr   Tr  r  rc   s    rH   r   zEagerExpr.allk  r  rK   c                0    |                      dd          S )Nr   Tr  r  rc   s    rH   r   zEagerExpr.maxn  r  rK   c                0    |                      dd          S )Nr   Tr  r  rc   s    rH   r   zEagerExpr.minq  r  rK   c                0    |                      dd          S )Nr   Tr  r  rc   s    rH   r   zEagerExpr.arg_mint      !!)D!AAArK   c                0    |                      dd          S )Nr   Tr  r  rc   s    rH   r   zEagerExpr.arg_maxw  r  rK   r  r  r  c                2    |                      d||          S )Nr  )r  r  r  r  s      rH   r  zEagerExpr.clip|  s(    
 !! " 
 
 	
rK   c                ,    |                      d          S )Nr   r  rc   s    rH   r   zEagerExpr.is_null  s    !!),,,rK   c                ,    |                      d          S )Nr   r  rc   s    rH   r   zEagerExpr.is_nan  s    !!(+++rK   r   r   r   r   r   r   c                4    |                      d|||          S )Nr   )r   r   r   r  r   s       rH   r   zEagerExpr.fill_null  s*     !!uxu " 
 
 	
rK   c                0    |                      d|          S )Nr   r  r  r   s     rH   r   zEagerExpr.is_in  s    !!'!777rK   c                ,    |                      d          S )Nr   r  rc   s    rH   r   zEagerExpr.arg_true  s    !!*---rK   
predicatesc                l    |                                  } |j        | }|                     d|          S )Nfilter)	predicate)rg   all_horizontalr  )rG   r'  plxr*  s       rH   r)  zEagerExpr.filter  s;    ))++&C&
3	!!(i!@@@rK   c                ,    |                      d          S )Nr   r  rc   s    rH   r   zEagerExpr.drop_nulls  r  rK   r   r   r   r   r   r   c               4    |                      d|||          S )Nr   )r   r   r   r  r   s       rH   r   zEagerExpr.replace_strict  s*     !!#3\ " 
 
 	
rK   r   r   c               2    |                      d||          S )Nr   )r   r   r  r   s      rH   r   zEagerExpr.sort  s    !!&ZJ!WWWrK   c                ,    |                      d          S )Nr   r  rc   s    rH   r   zEagerExpr.abs  s    !!%(((rK   c                0    |                      dd          S )Nr   F)maintain_orderr  rc   s    rH   r   zEagerExpr.unique  s    !!(5!AAArK   c                ,    |                      d          S )Nr   r  rc   s    rH   r   zEagerExpr.diff      !!&)))rK   r   r  r  r  r  c               6    |                      d||||          S )Nr	  )r   r  r  r  r  r  s        rH   r	  zEagerExpr.sample  s.     !!H?OVZ " 
 
 	
rK   r   c                     dfd} t                      fd j         j         j        | j         j         j         j        	  	        S )NrZ  ru   rB   c                X    t          |           dk    rd|  }t          |          gS Nr  z:Expected function with single output, found output names: r   
ValueErrorrZ  r  r   s     rH   r  z+EagerExpr.alias.<locals>.alias_output_names  3    5zzQZSXZZ oo%6MrK   c                2    fd |           D             S )Nc                :    g | ]}|                               S rE   r   )rx   r  r   s     rH   r{   z5EagerExpr.alias.<locals>.<lambda>.<locals>.<listcomp>  s%    BBBvT**BBBrK   rE   )r\   r   rG   s    rH   r  z!EagerExpr.alias.<locals>.<lambda>  s$    BBBBbBBB rK   r  rZ  ru   rB   ru   )r  r  r  rX   rU   rS   rV   r  )rG   r   r  s   `` rH   r   zEagerExpr.alias  s}    	 	 	 	 	 	 tDzzBBBBB+-"&"=1 1/M-

 

 

 
	
rK   c                ,    |                      d          S )Nr   r  rc   s    rH   r   zEagerExpr.is_unique      !!+...rK   c                ,    |                      d          S )Nr   r  rc   s    rH   r   zEagerExpr.is_first_distinct  s    !!"5666rK   c                ,    |                      d          S )Nr   r  rc   s    rH   r   zEagerExpr.is_last_distinct  s    !!"4555rK   r
  r   r  r8   c                4    |                      d||d          S )Nr
  T)r
  r  r  r  r  s      rH   r
  zEagerExpr.quantile  s-     !!'	 " 
 
 	
rK   c                0    |                      d|          S )Nr   r   r  r   s     rH   r   zEagerExpr.head      !!&A!...rK   c                0    |                      d|          S )Nr   rG  r  r   s     rH   r   zEagerExpr.tail  rH  rK   r   c                0    |                      d|          S )Nr   )r   r  r   s     rH   r   zEagerExpr.round  s    !!'H!===rK   c                0    |                      dd          S )Nr   Tr  r  rc   s    rH   r   zEagerExpr.len  r  rK   r/  c                2    |                      d||          S )Nr2  )r   r/  r  r1  s      rH   r2  zEagerExpr.gather_every  s    !!.Af!EEErK   c                ,    |                      d          S )Nr   r  rc   s    rH   r   zEagerExpr.mode  r4  rK   c                ,    |                      d          S )Nr   r  rc   s    rH   r   zEagerExpr.is_finite   rB  rK   r#  r  r$  c               4    |                      d|||          S )Nr)  r#  r  r$  r  r&  s       rH   r)  zEagerExpr.rolling_mean  s+    !!##	 " 
 
 	
rK   c               6    |                      d||||          S )Nr.  r#  r  r$  r   r  r+  s        rH   r.  zEagerExpr.rolling_std  0     !!## " 
 
 	
rK   c               4    |                      d|||          S )Nr'  rP  r  r&  s       rH   r'  zEagerExpr.rolling_sum  s)    !!{TZ " 
 
 	
rK   c               6    |                      d||||          S )Nr,  rR  r  r+  s        rH   r,  zEagerExpr.rolling_var  rS  rK   r  Callable[[Any], Any]c                     d	 fd}                      | j        dz    j        dz    j         j                   S )
Nr\   r   rB   r  c                    |           }d |D             }fd|D             }t          |d                   s+t                      x}d|                    |d                   rIt                                          j        j                  fdt          ||          D             }fd|D             }|S )Nc                    g | ]	}|j         
S rE   r  )rx   input_seriess     rH   r{   z7EagerExpr.map_batches.<locals>.func.<locals>.<listcomp>+  s    TTT,L-TTTrK   c                &    g | ]} |          S rE   rE   )rx   r  r  s     rH   r{   z7EagerExpr.map_batches.<locals>.func.<locals>.<listcomp>,  s#    GGG6hhv&&GGGrK   r   )ri   c                R    g | ]#\  }} |                               |          $S rE   r?  )rx   arrayoutput_name
from_numpys      rH   r{   z7EagerExpr.map_batches.<locals>.func.<locals>.<listcomp>3  sE       *{ Ju%%++K88  rK   c                :    g | ]}|                               S rE   )r   )rx   r  r   s     rH   r{   z7EagerExpr.map_batches.<locals>.func.<locals>.<listcomp>8  s%    III&++l33IIIrK   )r%   r$   isscalarr   rg   _seriesr_  zip)	r\   input_series_listoutput_namesr  npr_  r  r   rG   s	        @rH   r  z#EagerExpr.map_batches.<locals>.func)  s     $RTTBSTTTLGGGG5FGGGFfQi(( 	 {{"/BKKq	4J4J/$//119Dd  
   .1&,.G.G   'IIII&IIIMrK   r  z->map_batches)r  r  r  r  ri   r\   r   rB   r  )r  r  r  rX   rZ   )rG   r  r   r  s   ``` rH   r  zEagerExpr.map_batches&  sr    	 	 	 	 	 	 	 	$ ""+/-?"&"=#7 # 
 
 	
rK   EagerExprCatNamespace[Self]c                     t          |           S rD   )EagerExprCatNamespacerc   s    rH   rc  zEagerExpr.catD      $T***rK    EagerExprDateTimeNamespace[Self]c                     t          |           S rD   )EagerExprDateTimeNamespacerc   s    rH   ra  zEagerExpr.dtH  s    )$///rK   EagerExprListNamespace[Self]c                     t          |           S rD   )EagerExprListNamespacerc   s    rH   re  zEagerExpr.listL      %d+++rK   EagerExprNameNamespace[Self]c                     t          |           S rD   )EagerExprNameNamespacerc   s    rH   r   zEagerExpr.nameP  rr  rK   EagerExprStringNamespace[Self]c                     t          |           S rD   )EagerExprStringNamespacerc   s    rH   r   zEagerExpr.strT      '---rK   EagerExprStructNamespace[Self]c                     t          |           S rD   )EagerExprStructNamespacerc   s    rH   rg  zEagerExpr.structX  ry  rK   )r  r  r  ro   r  r   r  r  r  rY   r  r0   r  rT   r  r1   r  r  rB   ra   rg  )rB   r  rh  )r  r  r  ro   r  r   r  r  r  rY   ri   r2   r  r  rB   r&   )r  r   rB   r&   )
r  r   r  r   r  r  r  r   rB   r&   )r  r   rB   r  r  r  rB   r  )r\   r   r  r   r  r   r  r,   r  r  rB   r  )r  r  r  r   r  r   rB   r&   ry  rk  )r   r  rB   r&   )r   r  rB   r&   ri  rl  ru  rm  rp  )r'  r&   rB   r&   rr  rq  rs  rj  rt  ro  rn  rx  rv  rw  )r  rV  r   r   rB   r&   )rB   rh  )rB   rl  )rB   ro  )rB   rs  )rB   rv  )rB   rz  )\rN   rO   rP   r{  r  r`   rg   rd   r|  r  r  r  r  r  r  r  rR  r   r  r  rH  rF  rL  rJ  r4  r6  r8  r:  r  r<  r@  r  r>  r  rD  r  rB  r  rN  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   r2  r   r   r)  r.  r'  r,  r  r~  rc  ra  re  r   r   rg  rE   rK   rH   r<   r<   :  s         5444     .2        G G G G -,,, .2
 
 
 
 
 [
. 

 

 

 [

   %-1%
 %
 %
 %
 %
 %
T ).     
 1 1 1 [1! ! ! !F
 
 
 
:
 
 
 
.7 7 7 79 9 9 99 9 9 99 9 9 99 9 9 99 9 9 99 9 9 9: : : :9 9 9 9: : : :: : : :L L L L: : : :> > > >P P P P? ? ? ?Q Q Q Q: : : :L L L L: : : :L L L L0 0 0 0E E E EC C C C> > > >@ @ @ @? ? ? ?A A A A
 
 
 


 
 
 

? ? ? ?> > > >> > > >> > > >> > > >B B B BB B B B

 
 
 
- - - -, , , ,
 
 
 
8 8 8 8. . . .A A A A
0 0 0 0	
 	
 	
 	
X X X X) ) ) )B B B B* * * *

 

 

 


 
 
 
*/ / / /7 7 7 76 6 6 6
 
 
 
/ / / // / / /> > > >> > > >F F F F* * * */ / / /
 
 
 
	
 	
 	
 	

 
 
 

	
 	
 	
 	

 
 
 
< + + + X+ 0 0 0 X0 , , , X, , , , X, . . . X. . . . X. . .rK   r<   c                     e Zd ZU  e            Zded<    e            Zded<    e            Zded<    e            Zded<    e            Z	ded<    e            Z
ded<    e            Zded<    e            Zded	<    e            Zded
<    e            Zded<    e            Zded<    e            Zded<    e            Zded<   ed&d            Zed'd            Zd(dZd)dZd*dZed+d"            Zed,d$            Zd%S )-r=   r#   r   r   r   r   r   r   r   r	  r  r"  r2  r   rc  rB   0WindowFunction[CompliantLazyFrameT, NativeExprT]c                    d S rD   rE   rc   s    rH   window_functionzLazyExpr.window_functiono  s    SVSVrK   r  r  r  c                "    t          |d          S r  r  r  s     rH   r  zLazyExpr._is_exprr  r  rK   r  Callable[..., Any]r&   c                   d S rD   rE   )rG   r  s     rH   _with_callablezLazyExpr._with_callablev  rJ   rK   r  rY   c                   d S rD   rE   )rG   r  s     rH   _with_alias_output_namesz!LazyExpr._with_alias_output_namesw  rJ   rK   r   r   c                :    dfd}|                      |          S )NrZ  ru   rB   c                X    t          |           dk    rd|  }t          |          gS r8  r9  r;  s     rH   r}   zLazyExpr.alias.<locals>.fny  r<  rK   r@  )r  )rG   r   r}   s    ` rH   r   zLazyExpr.aliasx  s7    	 	 	 	 	 	 ,,R000rK   exprr   c                   d S rD   rE   )rk   r  r   s      rH   _alias_nativezLazyExpr._alias_native  s    LOCrK   LazyExprNameNamespace[Self]c                     t          |           S rD   )LazyExprNameNamespacerc   s    rH   r   zLazyExpr.name  rk  rK   N)rB   r  r}  )r  r  rB   r&   )r  rY   rB   r&   rj  )r  r   r   r   rB   r   )rB   r  )rN   rO   rP   r#   r   r{  r   r   r   r   r   r   r	  r  r"  r2  r   rc  r~  r  r|  r  r  r  r   r  r   rE   rK   rH   r=   r=   ]  s          /00G0000.00G0000 / 1 1H1111+O--D----+O--D----+O--D----+O--D-----o//F////#2?#4#4K4444 / 1 1H1111$3O$5$5L5555&5o&7&7N7777*?,,C,,,,VVV XV1 1 1 [1 GFFFOOOO1 1 1 1 OOO [O+ + + X+ + +rK   r=   c                  2    e Zd ZU ded<   edd            ZdS )_ExprNamespacer   _compliant_exprrB   c                    | j         S rD   r  rc   s    rH   	compliantz_ExprNamespace.compliant  s    ##rK   NrB   r   )rN   rO   rP   r{  r~  r  rE   rK   rH   r  r    sB          '&&&$ $ $ X$ $ $rK   r  c                      e Zd ZddZdS )EagerExprNamespacer  r   rB   ra   c                   || _         d S rD   r  rG   r  s     rH   r  zEagerExprNamespace.__init__      #rK   N)r  r   rB   ra   rN   rO   rP   r  rE   rK   rH   r  r    (        $ $ $ $ $ $rK   r  c                      e Zd ZddZdS )LazyExprNamespacer  r   rB   ra   c                   || _         d S rD   r  r  s     rH   r  zLazyExprNamespace.__init__  r  rK   N)r  r   rB   ra   r  rE   rK   rH   r  r    r  rK   r  c                      e Zd ZddZdS )rj  rB   r   c                8    | j                             dd          S )Nrc  get_categoriesr  r  rc   s    rH   r  z$EagerExprCatNamespace.get_categories  s    ~55e=MNNNrK   NrB   r   )rN   rO   rP   r  rE   rK   rH   rj  rj    s.        O O O O O OrK   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 S )'rn  formatr   rB   r   c                <    | j                             dd|          S )Nra  	to_stringr  r  rG   r  s     rH   r  z$EagerExprDateTimeNamespace.to_string  s     ~55dKPV5WWWrK   	time_zone
str | Nonec                <    | j                             dd|          S )Nra  replace_time_zoner  r  rG   r  s     rH   r  z,EagerExprDateTimeNamespace.replace_time_zone  )    ~55% 6 
 
 	
rK   c                <    | j                             dd|          S )Nra  convert_time_zoner  r  r  s     rH   r  z,EagerExprDateTimeNamespace.convert_time_zone  r  rK   	time_unitr:   c                <    | j                             dd|          S )Nra  	timestamp)r  r  )rG   r  s     rH   r  z$EagerExprDateTimeNamespace.timestamp  s(    ~55+ 6 
 
 	
rK   c                8    | j                             dd          S )Nra  dater  rc   s    rH   r  zEagerExprDateTimeNamespace.date      ~55dFCCCrK   c                8    | j                             dd          S )Nra  yearr  rc   s    rH   r  zEagerExprDateTimeNamespace.year  r  rK   c                8    | j                             dd          S )Nra  monthr  rc   s    rH   r  z EagerExprDateTimeNamespace.month  s    ~55dGDDDrK   c                8    | j                             dd          S )Nra  dayr  rc   s    rH   r  zEagerExprDateTimeNamespace.day  s    ~55dEBBBrK   c                8    | j                             dd          S )Nra  hourr  rc   s    rH   r  zEagerExprDateTimeNamespace.hour  r  rK   c                8    | j                             dd          S )Nra  minuter  rc   s    rH   r  z!EagerExprDateTimeNamespace.minute      ~55dHEEErK   c                8    | j                             dd          S )Nra  secondr  rc   s    rH   r  z!EagerExprDateTimeNamespace.second  r  rK   c                8    | j                             dd          S )Nra  millisecondr  rc   s    rH   r  z&EagerExprDateTimeNamespace.millisecond      ~55dMJJJrK   c                8    | j                             dd          S )Nra  microsecondr  rc   s    rH   r  z&EagerExprDateTimeNamespace.microsecond  r  rK   c                8    | j                             dd          S )Nra  
nanosecondr  rc   s    rH   r  z%EagerExprDateTimeNamespace.nanosecond  s    ~55dLIIIrK   c                8    | j                             dd          S )Nra  ordinal_dayr  rc   s    rH   r  z&EagerExprDateTimeNamespace.ordinal_day  r  rK   c                8    | j                             dd          S )Nra  weekdayr  rc   s    rH   r  z"EagerExprDateTimeNamespace.weekday  s    ~55dIFFFrK   c                8    | j                             dd          S )Nra  total_minutesr  rc   s    rH   r  z(EagerExprDateTimeNamespace.total_minutes      ~55dOLLLrK   c                8    | j                             dd          S )Nra  total_secondsr  rc   s    rH   r  z(EagerExprDateTimeNamespace.total_seconds  r  rK   c                8    | j                             dd          S )Nra  total_millisecondsr  rc   s    rH   r  z-EagerExprDateTimeNamespace.total_milliseconds      ~55d<PQQQrK   c                8    | j                             dd          S )Nra  total_microsecondsr  rc   s    rH   r  z-EagerExprDateTimeNamespace.total_microseconds  r  rK   c                8    | j                             dd          S )Nra  total_nanosecondsr  rc   s    rH   r  z,EagerExprDateTimeNamespace.total_nanoseconds  s    ~55d<OPPPrK   everyc                <    | j                             dd|          S )Nra  truncate)r  r  )rG   r  s     rH   r  z#EagerExprDateTimeNamespace.truncate  s    ~55dJe5TTTrK   N)r  r   rB   r   )r  r  rB   r   )r  r   rB   r   )r  r:   rB   r   r  )r  r   rB   r   )rN   rO   rP   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rE   rK   rH   rn  rn    s       X X X X
 
 
 


 
 
 


 
 
 

D D D DD D D DE E E EC C C CD D D DF F F FF F F FK K K KK K K KJ J J JK K K KG G G GM M M MM M M MR R R RR R R RQ Q Q QU U U U U UrK   rn  c                      e Zd ZddZdS )rq  rB   r   c                8    | j                             dd          S )Nre  r   r  rc   s    rH   r   zEagerExprListNamespace.len  s    ~55feDDDrK   Nr  )rN   rO   rP   r   rE   rK   rH   rq  rq    s.        E E E E E ErK   rq  c                  d    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ddZdS )CompliantExprNameNamespacerB   r   c                2    |                      d d          S )Nc                    | S rD   rE   r  s    rH   r  z1CompliantExprNameNamespace.keep.<locals>.<lambda>  s     rK   Fr?  r  rc   s    rH   keepzCompliantExprNameNamespace.keep  s    ""#4#4E"BBBrK   r  r   c                ,    |                      |          S rD   r  )rG   r  s     rH   mapzCompliantExprNameNamespace.map  s    ""8,,,rK   prefixr   c                4    |                      fd          S )Nc                     |  S rD   rE   )r   r  s    rH   r  z3CompliantExprNameNamespace.prefix.<locals>.<lambda>  s    60A40A0A rK   r  rG   r  s    `rH   r  z!CompliantExprNameNamespace.prefix  !    ""#A#A#A#ABBBrK   suffixc                4    |                      fd          S )Nc                    |   S rD   rE   )r   r  s    rH   r  z3CompliantExprNameNamespace.suffix.<locals>.<lambda>  s    40A0A0A rK   r  rG   r  s    `rH   r  z!CompliantExprNameNamespace.suffix  r  rK   c                @    |                      t          j                  S rD   )r  r   lowerrc   s    rH   to_lowercasez'CompliantExprNameNamespace.to_lowercase      ""39---rK   c                @    |                      t          j                  S rD   )r  r   upperrc   s    rH   to_uppercasez'CompliantExprNameNamespace.to_uppercase  r  rK   r  r   c                    d fd}|S )Nre  ru   rB   c                    fd| D             S )Nc                &    g | ]} |          S rE   rE   )rx   r   r  s     rH   r{   zNCompliantExprNameNamespace._alias_output_names.<locals>.fn.<locals>.<listcomp>  s!    8884DDJJ888rK   rE   )re  r  s    rH   r}   z:CompliantExprNameNamespace._alias_output_names.<locals>.fn  s    8888<8888rK   )re  ru   rB   ru   rE   )r  r}   s   ` rH   rZ   z.CompliantExprNameNamespace._alias_output_names  s(    	9 	9 	9 	9 	9 	9 	rK   Tr?  r   r   c                  d S rD   rE   )rG   r  r   s      rH   r  z)CompliantExprNameNamespace._from_callable  s    CrK   Nr  )r  r   rB   r   )r  r   rB   r   )r  r   rB   r   )r  r   rB   r   )r  r   r   r   rB   r   )rN   rO   rP   r  r  r  r  r  r  r}  rZ   r  rE   rK   rH   r  r    s        
C C C C- - - -C C C CC C C C. . . .. . . .    \ 48               rK   r  c                      e Zd Zdddd	Zd
S )ru  Tr?  r  r   r   r   rB   r   c                  | j          t                    fdj        j        j        |r|                               nd j        j        j        j	        	  	        S )Nc                t    fdt           |                               |                     D             S )Nc                R    g | ]#\  }}|                      |                    $S rE   r?  )rx   r  r   r  s      rH   r{   zKEagerExprNameNamespace._from_callable.<locals>.<lambda>.<locals>.<listcomp>"  sA        FD TT$ZZ((  rK   )rc  rX   )r\   r  r  s    rH   r  z7EagerExprNameNamespace._from_callable.<locals>.<lambda>"  sK        $'R$2M2Mb2Q2Q$R$R   rK   r  )
r  r  r  r  rX   rZ   rU   rS   rV   r  )rG   r  r   r  s    ` @rH   r  z%EagerExprNameNamespace._from_callable  s    ~tDzz     +-"&"=AFPt77===D 1/M-
 
 
 	
rK   N)r  r   r   r   rB   r   rN   rO   rP   r  rE   rK   rH   ru  ru    s9        
 CG 
 
 
 
 
 
 
 
rK   ru  c                      e Zd Zdddd	Zd
S )r  Tr?  r  r   r   r   rB   r   c              l    | j         }|r|                     |          nd }|                    |          S rD   )r  rZ   r  )rG   r  r   r  re  s        rH   r  z$LazyExprNameNamespace._from_callable6  s:    ~9>Ht//555D,,\:::rK   N)r  r   r   r   rB   r   r  rE   rK   rH   r  r  1  s9        
 CG ; ; ; ; ; ; ; ;rK   r  c                  n    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S )*rx  rB   r   c                8    | j                             dd          S )Nr   	len_charsr  rc   s    rH   r	  z"EagerExprStringNamespace.len_chars?  s    ~55e[IIIrK   patternr   r   r  r   r   ro   c               B    | j                             dd||||          S )Nr   replace)r
  r   r  r   r  )rG   r
  r   r  r   s        rH   r  z EagerExprStringNamespace.replaceB  s.    ~559gUGq 6 
 
 	
rK   c               @    | j                             dd|||          S )Nr   replace_all)r
  r   r  r  )rG   r
  r   r  s       rH   r  z$EagerExprStringNamespace.replace_allG  s,    ~55=' 6 
 
 	
rK   
charactersr  c                <    | j                             dd|          S )Nr   strip_chars)r  r  )rG   r  s     rH   r  z$EagerExprStringNamespace.strip_charsL  s(    ~55=Z 6 
 
 	
rK   r  c                <    | j                             dd|          S )Nr   starts_with)r  r  r  s     rH   r  z$EagerExprStringNamespace.starts_withQ       ~55e]SY5ZZZrK   r  c                <    | j                             dd|          S )Nr   	ends_with)r  r  r  s     rH   r  z"EagerExprStringNamespace.ends_withT  s     ~55e[QW5XXXrK   c               >    | j                             dd||          S )Nr   contains)r
  r  r  )rG   r
  r  s      rH   r  z!EagerExprStringNamespace.containsW  s*    ~55:w 6 
 
 	
rK   r/  lengthr   c                >    | j                             dd||          S )Nr   slice)r/  r  r  )rG   r/  r  s      rH   r  zEagerExprStringNamespace.slice\  s*    ~5576& 6 
 
 	
rK   byc                <    | j                             dd|          S )Nr   split)r  r  )rG   r  s     rH   r  zEagerExprStringNamespace.splita  s    ~55eW5LLLrK   r  c                <    | j                             dd|          S )Nr   to_datetimer  r  r  s     rH   r   z$EagerExprStringNamespace.to_datetimed  r  rK   c                8    | j                             dd          S )Nr   r  r  rc   s    rH   r  z%EagerExprStringNamespace.to_lowercaseg      ~55e^LLLrK   c                8    | j                             dd          S )Nr   r  r  rc   s    rH   r  z%EagerExprStringNamespace.to_uppercasej  r"  rK   Nr  )
r
  r   r   r   r  r   r   ro   rB   r   )r
  r   r   r   r  r   rB   r   )r  r  rB   r   )r  r   rB   r   )r  r   rB   r   )r
  r   r  r   rB   r   )r/  ro   r  r   rB   r   )r  r   rB   r   )r  r  rB   r   )rN   rO   rP   r	  r  r  r  r  r  r  r  r  r   r  r  rE   rK   rH   rx  rx  <  s"       J J J J
 
 
 


 
 
 


 
 
 

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


 
 
 

M M M M[ [ [ [M M M MM M M M M MrK   rx  c                      e Zd ZddZdS )r|  r   r   rB   r   c                b    | j                             dd|                              |          S )Nrg  fieldr  )r  r  r   r   s     rH   r&  zEagerExprStructNamespace.fieldq  s4    ~55hd5SSYY
 
 	
rK   N)r   r   rB   r   )rN   rO   rP   r&  rE   rK   rH   r|  r|  n  s(        
 
 
 
 
 
rK   r|  N)W
__future__r   	functoolsr   operatorr   typingr   r   r   r	   r
   r   r   r   !narwhals._compliant.any_namespacer   r   r   r   r   r   narwhals._compliant.namespacer   narwhals._compliant.typingr   r   r   r   r   r   r   r   r   r   r   narwhals._typing_compatr    r!   narwhals._utilsr"   r#   narwhals.dependenciesr$   r%   typing_extensionsr&   r'   r(   narwhals._compliant.seriesr)   r*   r+   r,   r-   narwhals._expression_parsingr.   r/   r0   r1   r2   narwhals.typingr3   r4   r5   r6   r7   r8   r9   r:   __all__r>   r;   r  r<   r=   r  r  r  rj  rn  rq  r  ru  r  rx  r|  rE   rK   rH   <module>r6     s5   " " " " " "       ! ! ! ! ! !	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	                = < < < < <                          ; : : : : : : : = = = = = = = = ; ; ; ; ; ; ; ; ........PPPPPPPP::::::              DCCCCCCCEEEEEEEEEE	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 C
B
B8 8 8 8 8 8 8 8~! ~! ~! ~! ~!J0OOP ~! ~! ~!B#b #b #b #b #b/#BBC ??@#b #b #bL`. `. `. `. `.o|34,-`. `. `.F)+ )+ )+ )+ )+%{23"K/0)+ )+ )+X$ $ $ $ $&'2C)D$ $ $$ $ $ $ $
3WZ5H $ $ $
$ $ $ $ $y1793E $ $ $
O O O O Oz"L$<gj>QO O OIU IU IU IU IUz"$5j$A7:CVIU IU IUXE E E E Ez"M*$=wz?RE E E              $%#$        F
 
 
 
 
z"z*J
 
 
.; ; ; ; ;i y)I; ; ;/M /M /M /M /Mz"OJ$?AT/M /M /Md
 
 
 
 
z"OJ$?AT
 
 
 
 
rK   