o
    h1                     @  s  d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dlm	Z	 d dlm
Z
 d dlmZ d d	lmZ d d
lmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm Z  d dlm!Z! d dlm"Z" d dlm#Z# d dlm$Z$ d dl%m&Z& d d l'm(Z( d d!l'm)Z) d d"l*m+Z+ d d#l,m-Z- d d$l,m.Z. d d%l,m/Z/ esej0d&krd dlmZ1 nd dlmZ1 nd dlmZ1 er~d d
lmZ d d'l2m3Z3 d d(l2m4Z4 d dlmZ d d)lm5Z5 d d*l6m7Z7 d dlmZ d d+lm8Z8 d d,lm9Z9 d d-l%m:Z: d d.l%m;Z; d d"l*m+Z+ d d/l<m=Z= d d0l<m>Z> d d1l<m?Z? d d2l<m@Z@ d d3l<mAZA d d4l<mBZB d d5l<mCZC d d6l,mDZD d d7l,mEZE d d8l,mFZF g d9ZGG d:d; d;eZHG d<d= d=e1eef ZIG d>d? d?eIeef e1eef ZJG d@dA dAeJe e"f e1e e"f ZKG dBdC dCeIee$f e1ee$f ZLG dDdE dEe-e ee ZMG dFdG dGeMe! ee! ZNG dHdI dIeMe# ee# ZOG dJdK dKeNe! ee! ee! ZPG dLdM dMeNe! ee! ee! ZQG dNdO dOeNe! ee! ee! ZRG dPdQ dQeMe ee ee ZSG dRdS dSeNe! eSe! ee! ZTG dTdU dUeOe# eSe# ee# ZUG dVdW dWeNe! ee! ee! ZVG dXdY dYeNe! ee! ee! ZWdS )Z    )annotationsN)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)!evaluate_output_names_and_aliases)	get_numpy)is_numpy_array)DType)_StoresCompliant)
deprecated)not_implemented)   	   )Self)TypeIs)EagerNamespace)CompliantSeries)	EvalNames)
EvalSeries)ExprKind)ExprMetadata)FillNullStrategy)NonNestedLiteral)NumericLiteral)
RankMethod)RollingInterpolationMethod)TemporalLiteral)TimeUnit)Implementation)Version)_FullContext)CompliantExpr	EagerExprLazyExpr
NativeExprc                   @  s$   e Zd ZdZdddZd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                 O     d S N selfr>   r?   rC   rC   L/var/www/vscode/kcb/lib/python3.10/site-packages/narwhals/_compliant/expr.pybetweenW       zNativeExpr.betweenc                 O  rA   rB   rC   rD   rC   rC   rF   isinX   rH   zNativeExpr.isinN)r>   r   r?   r   r@   r   )__name__
__module____qualname____doc__rG   rI   rC   rC   rC   rF   r=   P   s    
r=   c                   @  s  e Zd ZU ded< ded< ded< ded< d	ed
< ded< dddZdddZdddZedddZedd#d$Z	dd%d&Z
dd'd(Zdd)d*Zdd+d,Zdd/d0Zd d3d4Zdd5d6Zdd7d8Zdd9d:Zdd;d<Zdd=d>Zdd?d@ZddAdBZddCdDZddEdFZddGdHZddJdKZddLdMZddNdOZddPdQZddRdSZddZd[Zdd\d]Z dd^d_Z!dd`daZ"ddcddZ#ddedfZ$ddhdiZ%ddjdkZ&ddldmZ'ddndoZ(ddpdqZ)ddrdsZ*ddtduZ+ddvdwZ,ddzd{Z-dd|d}Z.dd~dZ/dddZ0dddZ1dddZ2dddZ3dddZ4d	ddZ5d
ddZ6dddZ7dddZ8dddZ9dddZ:e;dddZ<e;dddZ=e;dddZ>e;dddZ?e;dddZ@e;dddZAdddǄZBddd˄ZCddd̈́ZDdddτZEdddфZFeGd҃dddՄZHdddׄZIdddلZJdddۄZKddd݄ZLddd߄ZMdddZNdddZOdddZPdddZQdddZRdddZSdddZTdddZUdddZVdddZWdddZXdS (  r:   r7   _implementationtuple[int, ...]_backend_versionr8   _versionEvalNames[CompliantFrameT]_evaluate_output_namesAliasNames | None_alias_output_nameszExprMetadata | None	_metadatadfr   r@   )Sequence[CompliantSeriesOrNativeExprT_co]c                 C  rA   rB   rC   rE   rW   rC   rC   rF   __call__c      zCompliantExpr.__call__Nonec                 C  rA   rB   rC   rE   rC   rC   rF   __narwhals_expr__f   rH   zCompliantExpr.__narwhals_expr__)CompliantNamespace[CompliantFrameT, Self]c                 C  rA   rB   rC   r]   rC   rC   rF   __narwhals_namespace__g   rH   z$CompliantExpr.__narwhals_namespace__evaluate_column_namescontextr9   r(   c               C  rA   rB   rC   )clsra   rb   rC   rC   rF   from_column_namesh      zCompliantExpr.from_column_namesrc   
type[Self]column_indicesintc                G  rA   rB   rC   )rc   rb   rg   rC   rC   rF   from_column_indicesp      z!CompliantExpr.from_column_indicesc                 C  rA   rB   rC   r]   rC   rC   rF   is_nullu   rH   zCompliantExpr.is_nullc                 C  rA   rB   rC   r]   rC   rC   rF   absv   rH   zCompliantExpr.absc                 C  rA   rB   rC   r]   rC   rC   rF   allw   rH   zCompliantExpr.allc                 C  rA   rB   rC   r]   rC   rC   rF   anyx   rH   zCompliantExpr.anynamestrc                 C  rA   rB   rC   rE   ro   rC   rC   rF   aliasy   rH   zCompliantExpr.aliasdtypeDType | type[DType]c                 C  rA   rB   rC   rE   rs   rC   rC   rF   castz   rH   zCompliantExpr.castc                 C  rA   rB   rC   r]   rC   rC   rF   count{   rH   zCompliantExpr.countc                 C  rA   rB   rC   r]   rC   rC   rF   min|   rH   zCompliantExpr.minc                 C  rA   rB   rC   r]   rC   rC   rF   max}   rH   zCompliantExpr.maxc                 C  rA   rB   rC   r]   rC   rC   rF   arg_min~   rH   zCompliantExpr.arg_minc                 C  rA   rB   rC   r]   rC   rC   rF   arg_max   rH   zCompliantExpr.arg_maxc                 C  rA   rB   rC   r]   rC   rC   rF   arg_true   rH   zCompliantExpr.arg_truec                 C  rA   rB   rC   r]   rC   rC   rF   mean   rH   zCompliantExpr.meanc                 C  rA   rB   rC   r]   rC   rC   rF   sum   rH   zCompliantExpr.sumc                 C  rA   rB   rC   r]   rC   rC   rF   median   rH   zCompliantExpr.medianc                 C  rA   rB   rC   r]   rC   rC   rF   skew   rH   zCompliantExpr.skewddofc                C  rA   rB   rC   rE   r   rC   rC   rF   std   rH   zCompliantExpr.stdc                C  rA   rB   rC   r   rC   rC   rF   var   rH   zCompliantExpr.varc                 C  rA   rB   rC   r]   rC   rC   rF   n_unique   rH   zCompliantExpr.n_uniquec                 C  rA   rB   rC   r]   rC   rC   rF   
null_count   rH   zCompliantExpr.null_countc                 C  rA   rB   rC   r]   rC   rC   rF   
drop_nulls   rH   zCompliantExpr.drop_nullsvalueSelf | NonNestedLiteralstrategyFillNullStrategy | Nonelimit
int | Nonec                 C  rA   rB   rC   rE   r   r   r   rC   rC   rF   	fill_null   s   zCompliantExpr.fill_nullc                 C  rA   rB   rC   r]   rC   rC   rF   diff   rH   zCompliantExpr.diffc                 C  rA   rB   rC   r]   rC   rC   rF   unique   rH   zCompliantExpr.uniquec                 C  rA   rB   rC   r]   rC   rC   rF   len   rH   zCompliantExpr.lendecimalsc                 C  rA   rB   rC   rE   r   rC   rC   rF   round   rH   zCompliantExpr.roundc                 C  rA   rB   rC   r]   rC   rC   rF   mode   rH   zCompliantExpr.modenc                 C  rA   rB   rC   rE   r   rC   rC   rF   head   rH   zCompliantExpr.headc                 C  rA   rB   rC   r   rC   rC   rF   tail   rH   zCompliantExpr.tailc                 C  rA   rB   rC   r   rC   rC   rF   shift   rH   zCompliantExpr.shiftc                 C  rA   rB   rC   r]   rC   rC   rF   	is_finite   rH   zCompliantExpr.is_finitec                 C  rA   rB   rC   r]   rC   rC   rF   is_nan   rH   zCompliantExpr.is_nanc                 C  rA   rB   rC   r]   rC   rC   rF   	is_unique   rH   zCompliantExpr.is_uniquec                 C  rA   rB   rC   r]   rC   rC   rF   is_first_distinct   rH   zCompliantExpr.is_first_distinctc                 C  rA   rB   rC   r]   rC   rC   rF   is_last_distinct   rH   zCompliantExpr.is_last_distinctreverseboolc                C  rA   rB   rC   rE   r   rC   rC   rF   cum_sum   rH   zCompliantExpr.cum_sumc                C  rA   rB   rC   r   rC   rC   rF   	cum_count   rH   zCompliantExpr.cum_countc                C  rA   rB   rC   r   rC   rC   rF   cum_min   rH   zCompliantExpr.cum_minc                C  rA   rB   rC   r   rC   rC   rF   cum_max   rH   zCompliantExpr.cum_maxc                C  rA   rB   rC   r   rC   rC   rF   cum_prod   rH   zCompliantExpr.cum_prodotherr   c                 C  rA   rB   rC   rE   r   rC   rC   rF   is_in   rH   zCompliantExpr.is_in
descending
nulls_lastc                C  rA   rB   rC   rE   r   r   rC   rC   rF   sort   rH   zCompliantExpr.sortmethodr3   c                C  rA   rB   rC   )rE   r   r   rC   rC   rF   rank   rH   zCompliantExpr.rankold!Sequence[Any] | Mapping[Any, Any]newSequence[Any]return_dtypeDType | type[DType] | Nonec                C  rA   rB   rC   rE   r   r   r   rC   rC   rF   replace_strict      zCompliantExpr.replace_strictpartition_bySequence[str]order_bySequence[str] | Nonec                 C  rA   rB   rC   )rE   r   r   rC   rC   rF   over   r[   zCompliantExpr.overfractionfloat | Nonewith_replacementseedc                C  rA   rB   rC   rE   r   r   r   r   rC   rC   rF   sample   re   zCompliantExpr.samplequantilefloatinterpolationr4   c                 C  rA   rB   rC   rE   r   r   rC   rC   rF   r      r[   zCompliantExpr.quantilefunction9Callable[[CompliantSeries[Any]], CompliantExpr[Any, Any]]c                 C  rA   rB   rC   )rE   r   r   rC   rC   rF   map_batches      zCompliantExpr.map_batcheslower_bound.Self | NumericLiteral | TemporalLiteral | Noneupper_boundc                 C  rA   rB   rC   rE   r   r   rC   rC   rF   clip   r   zCompliantExpr.clipc                 C  rA   rB   rC   r]   rC   rC   rF   rp         zCompliantExpr.strc                 C  rA   rB   rC   r]   rC   rC   rF   ro      r   zCompliantExpr.namec                 C  rA   rB   rC   r]   rC   rC   rF   dt   r   zCompliantExpr.dtc                 C  rA   rB   rC   r]   rC   rC   rF   cat   r   zCompliantExpr.catc                 C  rA   rB   rC   r]   rC   rC   rF   list   r   zCompliantExpr.listc                 C  rA   rB   rC   r]   rC   rC   rF   struct   r   zCompliantExpr.structcomspan	half_lifealphaadjustmin_samplesignore_nullsc                C  rA   rB   rC   )rE   r   r   r   r   r   r   r   rC   rC   rF   ewm_mean   s   
zCompliantExpr.ewm_meanwindow_sizecenterc                C  rA   rB   rC   rE   r   r   r   rC   rC   rF   rolling_sum   r   zCompliantExpr.rolling_sumc                C  rA   rB   rC   r   rC   rC   rF   rolling_mean   r   zCompliantExpr.rolling_meanc                C  rA   rB   rC   rE   r   r   r   r   rC   rC   rF   rolling_var   re   zCompliantExpr.rolling_varc                C  rA   rB   rC   r   rC   rC   rF   rolling_std   re   zCompliantExpr.rolling_stdzSince `1.22.0`offsetc                 C  rA   rB   rC   rE   r   r   rC   rC   rF   gather_every  r   zCompliantExpr.gather_everyc                 C  rA   rB   rC   r   rC   rC   rF   __and__  rH   zCompliantExpr.__and__c                 C  rA   rB   rC   r   rC   rC   rF   __or__  rH   zCompliantExpr.__or__c                 C  rA   rB   rC   r   rC   rC   rF   __add__  rH   zCompliantExpr.__add__c                 C  rA   rB   rC   r   rC   rC   rF   __sub__  rH   zCompliantExpr.__sub__c                 C  rA   rB   rC   r   rC   rC   rF   __mul__  rH   zCompliantExpr.__mul__c                 C  rA   rB   rC   r   rC   rC   rF   __floordiv__  rH   zCompliantExpr.__floordiv__c                 C  rA   rB   rC   r   rC   rC   rF   __truediv__	  rH   zCompliantExpr.__truediv__c                 C  rA   rB   rC   r   rC   rC   rF   __mod__
  rH   zCompliantExpr.__mod__c                 C  rA   rB   rC   r   rC   rC   rF   __pow__  rH   zCompliantExpr.__pow__c                 C  rA   rB   rC   r   rC   rC   rF   __gt__  rH   zCompliantExpr.__gt__c                 C  rA   rB   rC   r   rC   rC   rF   __ge__  rH   zCompliantExpr.__ge__c                 C  rA   rB   rC   r   rC   rC   rF   __lt__  rH   zCompliantExpr.__lt__c                 C  rA   rB   rC   r   rC   rC   rF   __le__  rH   zCompliantExpr.__le__c                 C  rA   rB   rC   r]   rC   rC   rF   
__invert__  rH   zCompliantExpr.__invert__kind/Literal[ExprKind.AGGREGATION, ExprKind.LITERAL]c                 C  rA   rB   rC   )rE   r   rC   rC   rF   	broadcast  r[   zCompliantExpr.broadcastc                 C  s   | j dus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().
        N)rV   expansion_kindis_multi_unnamedr]   rC   rC   rF   _is_multi_output_unnamed  s   z&CompliantExpr._is_multi_output_unnamedN)rW   r   r@   rX   r@   r\   )r@   r_   )ra   rR   rb   r9   r@   r(   )rc   rf   rg   rh   rb   r9   r@   r(   r@   r(   ro   rp   r@   r(   rs   rt   r@   r(   r   rh   r@   r(   r   r   r   r   r   r   r@   r(   r   rh   r@   r(   r   rh   r@   r(   )r   r   r@   r(   r   r   r@   r(   r   r   r   r   r@   r(   )r   r3   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   r4   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   rh   r   r   r@   r(   r   rh   r   rh   r   r   r@   r(   
r   rh   r   rh   r   r   r   rh   r@   r(   r   rh   r   rh   r@   r(   r   r   r@   r(   r@   r   )YrJ   rK   rL   __annotations__rZ   r^   r`   classmethodrd   ri   rk   rl   rm   rn   rr   rv   rw   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   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   propertyrp   ro   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   rC   rC   rC   rF   r:   [   s   
 





























		
r:   c                   @  sF   e Zd ZU ded< ded< edddddZdddZdddZdS )DepthTrackingExprrh   _depthrp   _function_name )function_namerc   rf   ra   rR   rb   r9   r  r@   r(   c               C  rA   rB   rC   )rc   ra   rb   r  rC   rC   rF   rd   *  s   z#DepthTrackingExpr.from_column_namesr   c                 C  s
   | 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  r]   rC   rC   rF   _is_elementary4  s   
z DepthTrackingExpr._is_elementaryc                 C  s    t | j d| j d| j dS )Nz(depth=z, function_name=))typerJ   r  r  r]   rC   rC   rF   __repr__E  s    zDepthTrackingExpr.__repr__N)
rc   rf   ra   rR   rb   r9   r  rp   r@   r(   r  )r@   rp   )rJ   rK   rL   r  r  rd   r  r  rC   rC   rC   rF   r  #  s   
 
	r  c                   @  sx  e Zd ZU ded< ded< dddddZddd Zdd"d#Zdd$d%Zedddd*d+Z	edd.d/Z
d0dd1dd7d8Zd0d9dd:d;Zedd?d@ZddAdBZddFdGZddJdKZddNdOZddQdRZddSdTZddUdVZddWdXZddYdZZdd[d\Zdd^d_Zdd`daZddbdcZddddeZddfdgZddhdiZddjdkZddldmZddndoZ ddpdqZ!ddrdsZ"ddtduZ#ddvdwZ$ddxdyZ%ddzd{Z&dd|d}Z'dd~dZ(dddZ)dddZ*dddZ+dddZ,dddZ-dddZ.dddZ/dddZ0dddZ1dddZ2dddZ3dddZ4dddZ5dddZ6dddZ7dddZ8d ddZ9d!ddZ:dddZ;d"ddZ<dddZ=d#ddZ>d$ddZ?dddZ@dddĄZAdddƄZBd%dd̈́ZCd&ddЄZDddd҄ZEdddԄZFdddքZGd'dd܄ZHd(ddބZId(ddZJd)ddZKdddZLd*ddZMdddZNdddZOd+ddZPd,ddZQd+ddZRd,ddZSd-ddZTeUd.ddZVeUd/d dZWeUd0ddZXeUd1ddZYeUd2d	d
ZZeUd3ddZ[dS (4  r;   )EvalSeries[EagerDataFrameT, EagerSeriesT]_calldict[str, Any]_call_kwargsN)call_kwargscalldepthrh   r  rp   evaluate_output_namesEvalNames[EagerDataFrameT]alias_output_namesrT   implementationr7   backend_versionrO   versionr8   r#  dict[str, Any] | Noner@   r\   c          
      C  rA   rB   rC   )
rE   r$  r%  r  r&  r(  r)  r*  r+  r#  rC   rC   rF   __init__P  s   zEagerExpr.__init__rW   r   Sequence[EagerSeriesT]c                 C  
   |  |S rB   )r   rY   rC   rC   rF   rZ   ^     
zEagerExpr.__call__=EagerNamespace[EagerDataFrameT, EagerSeriesT, Self, Any, Any]c                 C  rA   rB   rC   r]   rC   rC   rF   r`   a  r[   z EagerExpr.__narwhals_namespace__c                 C  rA   rB   rC   r]   rC   rC   rF   r^   d  rH   zEagerExpr.__narwhals_expr__funcrb   r9   r(   c                C  s    | ||||||j |j|j|d	S )N)r%  r  r&  r(  r)  r*  r+  r#  rN   rP   rQ   )rc   r2  r%  r  r&  r(  rb   r#  rC   rC   rF   _from_callablef  s   zEagerExpr._from_callableseriesr   c              
     s.   |  fdddd fddd  j  j jdS )Nc                   s    gS rB   rC   _dfr5  rC   rF   <lambda>  s    z(EagerExpr._from_series.<locals>.<lambda>r   r5  c                   s    j gS rB   ro   r6  r8  rC   rF   r9    s    )r%  r  r&  r(  r)  r*  r+  r3  )rc   r5  rC   r8  rF   _from_series~  s   

zEagerExpr._from_seriesFreturns_scalarr#  method_namer=  r   expressifiable_argsr   c             	   K  sF   t | j|||pi |d}| j|| jd | j d| | j| j|| d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.
            call_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#  rb   )r   _reuse_series_innerr4  r  r  rS   rU   )rE   r>  r=  r#  r?  r2  rC   rC   rF   _reuse_series  s    zEagerExpr._reuse_seriesr=  c                C  s   i S rB   rC   )rE   r=  rC   rC   rF   _reuse_series_extra_kwargs  rj   z$EagerExpr._reuse_series_extra_kwargsobj
Self | AnyTypeIs[Self]c                 C  
   t |dS Nr^   hasattrrc   rG  rC   rC   rF   _is_expr     
zEagerExpr._is_exprc                  s   i | fdd|  D }t|fi jd|fdd D }t g \}}	dd |D t|	krNd|	 dd	d |D  }
t|
|S )
Nc                   s*   i | ]\}}| |r |n|qS rC   )rO  _evaluate_expr).0ro   r   )rW   rE   rC   rF   
<dictcomp>  s    z1EagerExpr._reuse_series_inner.<locals>.<dictcomp>rE  c                   s&   g | ]}r|  |n |qS rC   )_from_scalarrR  r5  )r   r=  rC   rF   
<listcomp>      z1EagerExpr._reuse_series_inner.<locals>.<listcomp>c                 S     g | ]}|j qS rC   r:  rR  srC   rC   rF   rV        ztSafety assertion failed, please report a bug to https://github.com/narwhals-dev/narwhals/issues
Expression aliases: z
Series names: c                 S  rX  rC   r:  rY  rC   rC   rF   rV    r[  )itemsr   rF  r   r   AssertionError)rE   rW   r>  r=  r#  r?  kwargsout_aliasesmsgrC   )rW   r   r=  rE   rF   rC    s6   	
zEagerExpr._reuse_series_innerseries_namespace5Literal['cat', 'dt', 'list', 'name', 'str', 'struct']r^  c              	     sL   j  fddjd j d d jji j d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                   s    fdd| D S )Nc                   s&   g | ]}t t |d i  qS )rC   )getattrrU  )r^  r>  rc  rC   rF   rV    rW  zGEagerExpr._reuse_series_namespace.<locals>.<lambda>.<locals>.<listcomp>rC   rW   r^  r>  rE   rc  rC   rF   r9    s    z3EagerExpr._reuse_series_namespace.<locals>.<lambda>r@  rA  .rB  )r4  r  r  rS   rU   r"  )rE   rc  r>  r^  rC   rg  rF   _reuse_series_namespace  s   z!EagerExpr._reuse_series_namespacer   r   c                   s<   d fdd}t  | j j j j j j j jd	S )	NrW   r   r@   list[EagerSeriesT]c                   s&   g } | D ]
}d|_ || q|S )NT)
_broadcastappend)rW   resultsresultr]   rC   rF   r2    s
   z!EagerExpr.broadcast.<locals>.funcr%  r  r&  r(  r*  r)  r+  r#  )rW   r   r@   rj  )	r  r  r  rS   rU   rP   rN   rQ   r"  )rE   r   r2  rC   r]   rF   r     s   zEagerExpr.broadcastrs   rt   c                 C     | j d|dS )Nrv   )rs   rD  ru   rC   rC   rF   rv        zEagerExpr.castr   c                 C  rp  )N__eq__r   rq  r   rC   rC   rF   rs    rr  zEagerExpr.__eq__c                 C  rp  )N__ne__rt  rq  r   rC   rC   rF   ru    rr  zEagerExpr.__ne__c                 C  rp  )Nr   rt  rq  r   rC   rC   rF   r     rr  zEagerExpr.__ge__c                 C  rp  )Nr   rt  rq  r   rC   rC   rF   r      rr  zEagerExpr.__gt__c                 C  rp  )Nr   rt  rq  r   rC   rC   rF   r   #  rr  zEagerExpr.__le__c                 C  rp  )Nr   rt  rq  r   rC   rC   rF   r   &  rr  zEagerExpr.__lt__Self | bool | Anyc                 C  rp  )Nr   rt  rq  r   rC   rC   rF   r   )  rr  zEagerExpr.__and__c                 C  rp  )Nr   rt  rq  r   rC   rC   rF   r   ,  rr  zEagerExpr.__or__c                 C  rp  )Nr   rt  rq  r   rC   rC   rF   r   /  rr  zEagerExpr.__add__c                 C  rp  )Nr   rt  rq  r   rC   rC   rF   r   2  rr  zEagerExpr.__sub__c                 C     |  djd|dS )Nliteral__rsub__rt  rr   rD  r   rC   rC   rF   ry  5     zEagerExpr.__rsub__c                 C  rp  )Nr   rt  rq  r   rC   rC   rF   r   8  rr  zEagerExpr.__mul__c                 C  rp  )Nr   rt  rq  r   rC   rC   rF   r   ;  rr  zEagerExpr.__truediv__c                 C  rw  )Nrx  __rtruediv__rt  rz  r   rC   rC   rF   r|  >  r{  zEagerExpr.__rtruediv__c                 C  rp  )Nr   rt  rq  r   rC   rC   rF   r   A  rr  zEagerExpr.__floordiv__c                 C  rw  )Nrx  __rfloordiv__rt  rz  r   rC   rC   rF   r}  D  r{  zEagerExpr.__rfloordiv__c                 C  rp  )Nr   rt  rq  r   rC   rC   rF   r   G  rr  zEagerExpr.__pow__c                 C  rw  )Nrx  __rpow__rt  rz  r   rC   rC   rF   r~  J  r{  zEagerExpr.__rpow__c                 C  rp  )Nr   rt  rq  r   rC   rC   rF   r   M  rr  zEagerExpr.__mod__c                 C  rw  )Nrx  __rmod__rt  rz  r   rC   rC   rF   r  P  r{  zEagerExpr.__rmod__c                 C  
   |  dS )Nr   rq  r]   rC   rC   rF   r   T  r0  zEagerExpr.__invert__c                 C     | j dddS )Nr   TrE  rq  r]   rC   rC   rF   r   X  rr  zEagerExpr.null_countc                 C  r  )Nr   TrE  rq  r]   rC   rC   rF   r   [  rr  zEagerExpr.n_uniquec                 C  r  )Nr~   TrE  rq  r]   rC   rC   rF   r~   ^  rr  zEagerExpr.sumc                 C  r  )Nrw   TrE  rq  r]   rC   rC   rF   rw   a  rr  zEagerExpr.countc                 C  r  )Nr}   TrE  rq  r]   rC   rC   rF   r}   d  rr  zEagerExpr.meanc                 C  r  )Nr   TrE  rq  r]   rC   rC   rF   r   g  rr  zEagerExpr.medianr   c                C     | j ddd|idS )Nr   Tr   r<  rq  r   rC   rC   rF   r   j  r{  zEagerExpr.stdc                C  r  )Nr   Tr   r<  rq  r   rC   rC   rF   r   m  r{  zEagerExpr.varc                 C  r  )Nr   TrE  rq  r]   rC   rC   rF   r   p  rr  zEagerExpr.skewc                 C  r  )Nrn   TrE  rq  r]   rC   rC   rF   rn   s  rr  zEagerExpr.anyc                 C  r  )Nrm   TrE  rq  r]   rC   rC   rF   rm   v  rr  zEagerExpr.allc                 C  r  )Nry   TrE  rq  r]   rC   rC   rF   ry   y  rr  zEagerExpr.maxc                 C  r  )Nrx   TrE  rq  r]   rC   rC   rF   rx   |  rr  zEagerExpr.minc                 C  r  )Nrz   TrE  rq  r]   rC   rC   rF   rz     rr  zEagerExpr.arg_minc                 C  r  )Nr{   TrE  rq  r]   rC   rC   rF   r{     rr  zEagerExpr.arg_maxr   r   r   c                 C     | j d||dS )Nr   )r   r   rq  r   rC   rC   rF   r     s   zEagerExpr.clipc                 C  r  )Nrk   rq  r]   rC   rC   rF   rk     r0  zEagerExpr.is_nullc                 C  r  )Nr   rq  r]   rC   rC   rF   r     r0  zEagerExpr.is_nanr   r   r   r   r   r   c                 C     | j d|||dS )Nr   )r   r   r   rq  r   rC   rC   rF   r     s   zEagerExpr.fill_nullc                 C  rp  )Nr   rt  rq  r   rC   rC   rF   r     rr  zEagerExpr.is_inc                 C  r  )Nr|   rq  r]   rC   rC   rF   r|     r0  zEagerExpr.arg_true
predicatesc                 G  s    |   }|j| }| jd|dS )Nfilter)	predicate)r`   all_horizontalrD  )rE   r  plxr  rC   rC   rF   r    s   
zEagerExpr.filterc                 C  r  )Nr   rq  r]   rC   rC   rF   r     r0  zEagerExpr.drop_nullsr   r   r   r   r   r   c                C  r  )Nr   )r   r   r   rq  r   rC   rC   rF   r     s   zEagerExpr.replace_strictr   r   c                C  r  )Nr   )r   r   rq  r   rC   rC   rF   r        zEagerExpr.sortc                 C  r  )Nrl   rq  r]   rC   rC   rF   rl     r0  zEagerExpr.absc                 C  r  )Nr   F)maintain_orderrq  r]   rC   rC   rF   r     rr  zEagerExpr.uniquec                 C  r  )Nr   rq  r]   rC   rC   rF   r     r0  zEagerExpr.diffr   r   r   r   r   c                C     | j d||||dS )Nr   )r   r   r   r   rq  r   rC   rC   rF   r     s   
zEagerExpr.samplero   c                   sD   d	 fdd}t  fddjjj|jjjjd	S )
Nnamesr   r@   c                   s$   t | dkrd|  }t| gS )Nr@  z:Expected function with single output, found output names: )r   
ValueError)r  rb  r:  rC   rF   r(    s   
z+EagerExpr.alias.<locals>.alias_output_namesc                   s    fdd| D S )Nc                      g | ]}|  qS rC   rr   rU  r:  rC   rF   rV        z5EagerExpr.alias.<locals>.<lambda>.<locals>.<listcomp>rC   rf  ro   rE   rC   rF   r9    r  z!EagerExpr.alias.<locals>.<lambda>ro  )r  r   r@   r   )r  r  r  rS   rP   rN   rQ   r"  )rE   ro   r(  rC   r  rF   rr     s   zEagerExpr.aliasc                 C  r  )Nr   rq  r]   rC   rC   rF   r     r0  zEagerExpr.is_uniquec                 C  r  )Nr   rq  r]   rC   rC   rF   r     r0  zEagerExpr.is_first_distinctc                 C  r  )Nr   rq  r]   rC   rC   rF   r     r0  zEagerExpr.is_last_distinctr   r   r   r4   c                 C  s   | j d||ddS )Nr   T)r   r   r=  rq  r   rC   rC   rF   r     s   zEagerExpr.quantilec                 C  rp  )Nr   r   rq  r   rC   rC   rF   r     rr  zEagerExpr.headc                 C  rp  )Nr   r  rq  r   rC   rC   rF   r     rr  zEagerExpr.tailr   c                 C  rp  )Nr   )r   rq  r   rC   rC   rF   r     rr  zEagerExpr.roundc                 C  r  )Nr   TrE  rq  r]   rC   rC   rF   r     rr  zEagerExpr.lenr   c                 C  r  )Nr   )r   r   rq  r   rC   rC   rF   r     r  zEagerExpr.gather_everyc                 C  r  )Nr   rq  r]   rC   rC   rF   r     r0  zEagerExpr.modec                 C  r  )Nr   rq  r]   rC   rC   rF   r     r0  zEagerExpr.is_finiter   r   r   c                C  r  )Nr   r   r   r   rq  r   rC   rC   rF   r     s   zEagerExpr.rolling_meanc                C  r  )Nr   r   r   r   r   rq  r   rC   rC   rF   r        zEagerExpr.rolling_stdc                C  r  )Nr   r  rq  r   rC   rC   rF   r   !  s   zEagerExpr.rolling_sumc                C  r  )Nr   r  rq  r   rC   rC   rF   r   &  r  zEagerExpr.rolling_varr   Callable[[Any], Any]c                   s8   d
 fdd}j |jd jd jjd	S )NrW   r   r@   r.  c                   s   | }dd |D }fdd|D }t |d s(t  }d ur>||d r>t jjd  fddt||D }d urKfdd|D }|S )Nc                 S  rX  rC   r:  )rR  input_seriesrC   rC   rF   rV  8  r[  z7EagerExpr.map_batches.<locals>.func.<locals>.<listcomp>c                      g | ]} |qS rC   rC   rU  )r   rC   rF   rV  9      r   )rb   c                   s   g | ]\}} | |qS rC   r  )rR  arrayoutput_name
from_numpyrC   rF   rV  @      c                   r  rC   )rv   rU  )r   rC   rF   rV  E  r  )r!   r    isscalarr   r`   _seriesr  zip)rW   input_series_listoutput_namesrn  npr   r   rE   r  rF   r2  6  s   
z#EagerExpr.map_batches.<locals>.funcr@  z->map_batches)r%  r  r&  r(  rb   rW   r   r@   r.  )r4  r  r  rS   rU   )rE   r   r   r2  rC   r  rF   r   1  s   zEagerExpr.map_batchesEagerExprCatNamespace[Self]c                 C     t | S rB   )EagerExprCatNamespacer]   rC   rC   rF   r   Q     zEagerExpr.cat EagerExprDateTimeNamespace[Self]c                 C  r  rB   )EagerExprDateTimeNamespacer]   rC   rC   rF   r   U  r  zEagerExpr.dtEagerExprListNamespace[Self]c                 C  r  rB   )EagerExprListNamespacer]   rC   rC   rF   r   Y  r  zEagerExpr.listEagerExprNameNamespace[Self]c                 C  r  rB   )EagerExprNameNamespacer]   rC   rC   rF   ro   ]  r  zEagerExpr.nameEagerExprStringNamespace[Self]c                 C  r  rB   )EagerExprStringNamespacer]   rC   rC   rF   rp   a  r  zEagerExpr.strEagerExprStructNamespace[Self]c                 C  r  rB   )EagerExprStructNamespacer]   rC   rC   rF   r   e  r  zEagerExpr.struct)r$  r  r%  rh   r  rp   r&  r'  r(  rT   r)  r7   r*  rO   r+  r8   r#  r,  r@   r\   r  )r@   r1  r   )r2  r  r%  rh   r  rp   r&  r'  r(  rT   rb   r9   r#  r,  r@   r(   )r5  r   r@   r(   )
r>  rp   r=  r   r#  r,  r?  r   r@   r(   )r=  r   r@   r!  rG  rH  r@   rI  )rW   r   r>  rp   r=  r   r#  r!  r?  r!  r@   r.  )rc  rd  r>  rp   r^  r   r@   r(   r  r  )r   rH  r@   r(   )r   rv  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  )\rJ   rK   rL   r  r-  rZ   r`   r^   r  r4  r;  rD  rF  rO  rC  ri  r   rv   rs  ru  r   r   r   r   r   r   r   r   ry  r   r   r|  r   r}  r   r~  r   r  r   r   r   r~   rw   r}   r   r   r   r   rn   rm   ry   rx   rz   r{   r   rk   r   r   r   r|   r  r   r   r   rl   r   r   r   rr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r   r   ro   rp   r   rC   rC   rC   rF   r;   I  s   
 
*#	

 r;   c                   @  s   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dZd#ddZd$ddZed%dd Zd!S )&r<   r%   rz   r{   r|   r   r   r   r   r   r   r   r   r   r   rG  rH  r@   rI  c                 C  rJ  rK  rL  rN  rC   rC   rF   rO  |  rP  zLazyExpr._is_exprr$  Callable[..., Any]r(   c                C  rA   rB   rC   )rE   r$  rC   rC   rF   _with_callable  rH   zLazyExpr._with_callabler2  rT   c                C  rA   rB   rC   )rE   r2  rC   rC   rF   _with_alias_output_names  rH   z!LazyExpr._with_alias_output_namesLazyExprNameNamespace[Self]c                 C  r  rB   )LazyExprNameNamespacer]   rC   rC   rF   ro     r  zLazyExpr.nameNr  )r$  r  r@   r(   )r2  rT   r@   r(   )r@   r  )rJ   rK   rL   r%   rz   r  r{   r|   r   r   r   r   r   r   r   r   r   r   r  rO  r  r  r  ro   rC   rC   rC   rF   r<   j  s(   
 

r<   c                   @  s$   e Zd ZU ded< edddZdS )_ExprNamespacer   _compliant_exprr@   c                 C  s   | j S rB   r  r]   rC   rC   rF   	compliant  s   z_ExprNamespace.compliantNr@   r   )rJ   rK   rL   r  r  r  rC   rC   rC   rF   r    s   
 r  c                   @     e Zd ZdddZdS )	EagerExprNamespaceexprr   r@   r\   c                C  
   || _ d S rB   r  rE   r  rC   rC   rF   r-    r0  zEagerExprNamespace.__init__N)r  r   r@   r\   rJ   rK   rL   r-  rC   rC   rC   rF   r        r  c                   @  r  )	LazyExprNamespacer  r   r@   r\   c                C  r  rB   r  r  rC   rC   rF   r-    r0  zLazyExprNamespace.__init__N)r  r   r@   r\   r  rC   rC   rC   rF   r    r  r  c                   @     e Zd ZdddZdS )r  r@   r   c                 C     | j ddS )Nr   get_categoriesr  ri  r]   rC   rC   rF   r    rr  z$EagerExprCatNamespace.get_categoriesNr@   r   )rJ   rK   rL   r  rC   rC   rC   rF   r        r  c                   @  s   e Zd Zd4ddZd5d	d
Zd6ddZd7ddZd8ddZd8ddZd8ddZ	d8ddZ
d8ddZd8ddZd8ddZd8dd Zd8d!d"Zd8d#d$Zd8d%d&Zd8d'd(Zd8d)d*Zd8d+d,Zd8d-d.Zd8d/d0Zd8d1d2Zd3S )9r  formatrp   r@   r   c                 C     | j jdd|dS )Nr   	to_stringr  r  rE   r  rC   rC   rF   r       z$EagerExprDateTimeNamespace.to_string	time_zone
str | Nonec                 C  r  )Nr   replace_time_zoner  r  rE   r  rC   rC   rF   r       z,EagerExprDateTimeNamespace.replace_time_zonec                 C  r  )Nr   convert_time_zoner  r  r  rC   rC   rF   r    r  z,EagerExprDateTimeNamespace.convert_time_zone	time_unitr6   c                 C  r  )Nr   	timestamp)r  r  )rE   r  rC   rC   rF   r    r  z$EagerExprDateTimeNamespace.timestampc                 C  r  )Nr   dater  r]   rC   rC   rF   r    rr  zEagerExprDateTimeNamespace.datec                 C  r  )Nr   yearr  r]   rC   rC   rF   r    rr  zEagerExprDateTimeNamespace.yearc                 C  r  )Nr   monthr  r]   rC   rC   rF   r    rr  z EagerExprDateTimeNamespace.monthc                 C  r  )Nr   dayr  r]   rC   rC   rF   r    rr  zEagerExprDateTimeNamespace.dayc                 C  r  )Nr   hourr  r]   rC   rC   rF   r    rr  zEagerExprDateTimeNamespace.hourc                 C  r  )Nr   minuter  r]   rC   rC   rF   r    rr  z!EagerExprDateTimeNamespace.minutec                 C  r  )Nr   secondr  r]   rC   rC   rF   r    rr  z!EagerExprDateTimeNamespace.secondc                 C  r  )Nr   millisecondr  r]   rC   rC   rF   r    rr  z&EagerExprDateTimeNamespace.millisecondc                 C  r  )Nr   microsecondr  r]   rC   rC   rF   r    rr  z&EagerExprDateTimeNamespace.microsecondc                 C  r  )Nr   
nanosecondr  r]   rC   rC   rF   r    rr  z%EagerExprDateTimeNamespace.nanosecondc                 C  r  )Nr   ordinal_dayr  r]   rC   rC   rF   r    rr  z&EagerExprDateTimeNamespace.ordinal_dayc                 C  r  )Nr   weekdayr  r]   rC   rC   rF   r    rr  z"EagerExprDateTimeNamespace.weekdayc                 C  r  )Nr   total_minutesr  r]   rC   rC   rF   r    rr  z(EagerExprDateTimeNamespace.total_minutesc                 C  r  )Nr   total_secondsr  r]   rC   rC   rF   r    rr  z(EagerExprDateTimeNamespace.total_secondsc                 C  r  )Nr   total_millisecondsr  r]   rC   rC   rF   r    rr  z-EagerExprDateTimeNamespace.total_millisecondsc                 C  r  )Nr   total_microsecondsr  r]   rC   rC   rF   r    rr  z-EagerExprDateTimeNamespace.total_microsecondsc                 C  r  )Nr   total_nanosecondsr  r]   rC   rC   rF   r    rr  z,EagerExprDateTimeNamespace.total_nanosecondsN)r  rp   r@   r   )r  r  r@   r   )r  rp   r@   r   )r  r6   r@   r   r  )rJ   rK   rL   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rC   rC   rC   rF   r    s,    



















r  c                   @  r  )r  r@   r   c                 C  r  )Nr   r   r  r]   rC   rC   rF   r     rr  zEagerExprListNamespace.lenNr  )rJ   rK   rL   r   rC   rC   rC   rF   r    r  r  c                   @  sf   e Zd ZdddZd ddZd!ddZd"ddZdddZdddZe	d#ddZ
ddd$ddZdS )%CompliantExprNameNamespacer@   r   c                 C  s   | j dd ddS )Nc                 S  s   | S rB   rC   r:  rC   rC   rF   r9    rH   z1CompliantExprNameNamespace.keep.<locals>.<lambda>Fr  r4  r]   rC   rC   rF   keep  r  zCompliantExprNameNamespace.keepr   r   c                 C  r/  rB   r  )rE   r   rC   rC   rF   map  r0  zCompliantExprNameNamespace.mapprefixrp   c                      |   fddS )Nc                   s     |  S rB   rC   r:  r  rC   rF   r9        z3CompliantExprNameNamespace.prefix.<locals>.<lambda>r  rE   r  rC   r  rF   r    r  z!CompliantExprNameNamespace.prefixsuffixc                   r  )Nc                   s   |    S rB   rC   r:  r  rC   rF   r9    r  z3CompliantExprNameNamespace.suffix.<locals>.<lambda>r  rE   r  rC   r  rF   r    r  z!CompliantExprNameNamespace.suffixc                 C     |  tjS rB   )r4  rp   lowerr]   rC   rC   rF   to_lowercase     z'CompliantExprNameNamespace.to_lowercasec                 C  r  rB   )r4  rp   upperr]   rC   rC   rF   to_uppercase  r  z'CompliantExprNameNamespace.to_uppercaser2  r   c                  s   d fdd}|S )Nr  r   r@   c                  s    fdd| D S )Nc                   r  rC   rC   )rR  ro   r2  rC   rF   rV    r  zNCompliantExprNameNamespace._alias_output_names.<locals>.fn.<locals>.<listcomp>rC   )r  r  rC   rF   fn  r  z:CompliantExprNameNamespace._alias_output_names.<locals>.fn)r  r   r@   r   rC   )r2  r  rC   r  rF   rU   
  s   z.CompliantExprNameNamespace._alias_output_namesTr  rr   r   c               C  rA   rB   rC   rE   r2  rr   rC   rC   rF   r4    r[   z)CompliantExprNameNamespace._from_callableNr  )r   r   r@   r   )r  rp   r@   r   )r  rp   r@   r   )r2  r   r@   r   )r2  r   rr   r   r@   r   )rJ   rK   rL   r  r  r  r  r  r   staticmethodrU   r4  rC   rC   rC   rF   r    s    





r  c                   @     e Zd Zdddd	d
ZdS )r  Tr  r2  r   rr   r   r@   r   c                 sJ   | j  t  fdd j j j|r| nd  j j j j	d	S )Nc                   s"   fddt  |  | D S )Nc                   s   g | ]\}}|  |qS rC   r  )rR  r5  ro   r  rC   rF   rV    r  zKEagerExprNameNamespace._from_callable.<locals>.<lambda>.<locals>.<listcomp>)r  rS   rf  r  r2  rC   rF   r9    s   
 z7EagerExprNameNamespace._from_callable.<locals>.<lambda>ro  )
r  r  r  r  rS   rU   rP   rN   rQ   r"  r  rC   r  rF   r4    s   z%EagerExprNameNamespace._from_callableN)r2  r   rr   r   r@   r   rJ   rK   rL   r4  rC   rC   rC   rF   r        r  c                   @  r  )r  Tr  r2  r   rr   r   r@   r   c               C  s"   | j }|r
| |nd }||S rB   )r  rU   r  )rE   r2  rr   r  r  rC   rC   rF   r4  2  s   
z$LazyExprNameNamespace._from_callableN)r2  r   rr   r   r@   r   r  rC   rC   rC   rF   r  -  r  r  c                   @  s   e Zd Zd,ddZd-ddZd.ddZd/ddZd0ddZd1ddZd2ddZ	d3dd Z
d4d"d#Zd5d%d&Zd,d'd(Zd,d)d*Zd+S )6r  r@   r   c                 C  r  )Nrp   	len_charsr  r]   rC   rC   rF   r	  ;  rr  z"EagerExprStringNamespace.len_charspatternrp   r   rx  r   r   rh   c                C  s   | j jdd||||dS )Nrp   replace)r
  r   rx  r   r  )rE   r
  r   rx  r   rC   rC   rF   r  >  s   z EagerExprStringNamespace.replacec                C  s   | j jdd|||dS )Nrp   replace_all)r
  r   rx  r  )rE   r
  r   rx  rC   rC   rF   r  C  s   
z$EagerExprStringNamespace.replace_all
charactersr  c                 C  r  )Nrp   strip_chars)r  r  )rE   r  rC   rC   rF   r  H  r  z$EagerExprStringNamespace.strip_charsr  c                 C  r  )Nrp   starts_withr  r  r  rC   rC   rF   r  M  r  z$EagerExprStringNamespace.starts_withr  c                 C  r  )Nrp   	ends_withr  r  r  rC   rC   rF   r  P  r  z"EagerExprStringNamespace.ends_withc                C     | j jdd||dS )Nrp   contains)r
  rx  r  )rE   r
  rx  rC   rC   rF   r  S     z!EagerExprStringNamespace.containsr   lengthr   c                 C  r  )Nrp   slice)r   r  r  )rE   r   r  rC   rC   rF   r  X  r  zEagerExprStringNamespace.slicebyc                 C  r  )Nrp   split)r  r  )rE   r  rC   rC   rF   r  ]  r  zEagerExprStringNamespace.splitr  c                 C  r  )Nrp   to_datetimer  r  r  rC   rC   rF   r  `  r  z$EagerExprStringNamespace.to_datetimec                 C  r  )Nrp   r  r  r]   rC   rC   rF   r  c  rr  z%EagerExprStringNamespace.to_lowercasec                 C  r  )Nrp   r   r  r]   rC   rC   rF   r   f  rr  z%EagerExprStringNamespace.to_uppercaseNr  )
r
  rp   r   rp   rx  r   r   rh   r@   r   )r
  rp   r   rp   rx  r   r@   r   )r  r  r@   r   )r  rp   r@   r   )r  rp   r@   r   )r
  rp   rx  r   r@   r   )r   rh   r  r   r@   r   )r  rp   r@   r   )r  r  r@   r   )rJ   rK   rL   r	  r  r  r  r  r  r  r  r  r  r  r   rC   rC   rC   rF   r  8  s    










r  c                   @  r  )	r  ro   rp   r@   r   c                 C  s   | j jdd|d|S )Nr   fieldr:  )r  ri  rr   rq   rC   rC   rF   r  m  s   zEagerExprStructNamespace.fieldN)ro   rp   r@   r   )rJ   rK   rL   r  rC   rC   rC   rF   r  j  r  r  )X
__future__r   sys	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._expression_parsingr   narwhals.dependenciesr    r!   narwhals.dtypesr"   narwhals.utilsr#   r$   r%   version_info
Protocol38typing_extensionsr(   r)   r*   narwhals._compliant.seriesr+   r,   r-   r.   r/   narwhals.typingr0   r1   r2   r3   r4   r5   r6   r7   r8   r9   __all__r=   r:   r  r;   r<   r  r  r  r  r  r  r  r  r  r  r  rC   rC   rC   rF   <module>   s    
 
I


&

    
%






I

#


2