
    LpjE	                        S SK Jr  S SKJrJr  S SKJr  \(       a"  S SKJrJ	r	  S SK
Jr  S SKJr  S SKJrJr  S SKJr   " S	 S
5      r " S S5      rg)    )annotations)TYPE_CHECKINGcast)is_sequence_of)IteratorSequence)GroupBy)LazyGroupBy)PolarsDataFramePolarsLazyFrame)
PolarsExprc                  l    \ rS rSr% S\S'   S\S'   \SS j5       r        SS jrSS jrSS	 jr	S
r
g)PolarsGroupBy   r   _compliant_frameNativeGroupBy_groupedc                    U R                   $ Nr   selfs    U/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/narwhals/_polars/group_by.py	compliantPolarsGroupBy.compliant       $$$    c              D   [        U5      U l        U(       a  UR                  U5      OUU l        [	        U[
        5      (       a+  U R                  R                  R                  U5      U l	        g U R                  R                  R                  S U 5       5      U l	        g )Nc              3  8   #    U  H  oR                   v   M     g 7fr   native.0args     r   	<genexpr>)PolarsGroupBy.__init__.<locals>.<genexpr>&        /Kds

d   
list_keys
drop_nullsr   r   strr   r!   group_byr   r   dfkeysdrop_null_keyss       r   __init__PolarsGroupBy.__init__   {     $Z
7Ed 32 dC(( NN!!**40 	 &&///Kd/KK 	r   c                |    U R                   R                  S U 5       5      nU R                  R                  U5      $ )Nc              3  8   #    U  H  oR                   v   M     g 7fr   r    r"   s     r   r%   $PolarsGroupBy.agg.<locals>.<genexpr>*        &BTczzTr(   r   aggr   _with_nativer   aggs
agg_results      r   r;   PolarsGroupBy.agg)   1    ]]&&&BT&BB
~~**:66r   c              #     #    U R                    H7  u  p[        [        SU5      5      U R                  R	                  U5      4v   M9     g 7f)Nr-   )r   tupler   r   r<   )r   keyr0   s      r   __iter__PolarsGroupBy.__iter__-   s;     }}GCUC()4>>+F+Fr+JJJ %s   A	Ar   r   r+   N)returnr   )r0   r   r1   $Sequence[PolarsExpr] | Sequence[str]r2   boolrH   None)r>   r   rH   r   )rH   z1Iterator[tuple[tuple[str, ...], PolarsDataFrame]])__name__
__module____qualname____firstlineno____annotations__propertyr   r3   r;   rE   __static_attributes__ r   r   r   r      sV    %%% %

 3
 
 

 7Kr   r   c                  b    \ rS rSr% S\S'   S\S'   \SS j5       r        SS jrSS jrS	r	g
)PolarsLazyGroupBy2   r   r   NativeLazyGroupByr   c                    U R                   $ r   r   r   s    r   r   PolarsLazyGroupBy.compliant6   r   r   c              D   [        U5      U l        U(       a  UR                  U5      OUU l        [	        U[
        5      (       a+  U R                  R                  R                  U5      U l	        g U R                  R                  R                  S U 5       5      U l	        g )Nc              3  8   #    U  H  oR                   v   M     g 7fr   r    r"   s     r   r%   -PolarsLazyGroupBy.__init__.<locals>.<genexpr>G   r'   r(   r)   r/   s       r   r3   PolarsLazyGroupBy.__init__:   r5   r   c                |    U R                   R                  S U 5       5      nU R                  R                  U5      $ )Nc              3  8   #    U  H  oR                   v   M     g 7fr   r    r"   s     r   r%   (PolarsLazyGroupBy.agg.<locals>.<genexpr>K   r9   r(   r:   r=   s      r   r;   PolarsLazyGroupBy.aggJ   rA   r   rG   N)rH   r   )r0   r   r1   rI   r2   rJ   rH   rK   )r>   r   rH   r   )
rL   rM   rN   rO   rP   rQ   r   r3   r;   rR   rS   r   r   rU   rU   2   sP    %%% %

 3
 
 

 7r   rU   N)
__future__r   typingr   r   narwhals._utilsr   collections.abcr   r   polars.dataframe.group_byr	   r   polars.lazyframe.group_byr
   rW   narwhals._polars.dataframer   r   narwhals._polars.exprr   r   rU   rS   r   r   <module>rj      s7    " & *2BJK0K KB7 7r   