+
    xȇiwZ                        ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHtH	t	H
t
Ht ^ RIHt ^ RIHt ]P"                  ! RR.RR.]
! RR7      R . R$O]P$                  ! . R$O4      ]! ]! ]! ^	4      . R$OR	R
7      4      ]! . R%O4      ]! . R%O4      ]! . R&O4      ..
R7      R 4       t]P"                  ! R	R.R7      R 4       t]P"                  R 4       t]P"                  R 4       t]P"                  R 4       tR'R lt]P8                  P;                  R. R(O4      R 4       t]P8                  P;                  RRR.4      R 4       t]P8                  P;                  RRR.4      ]P8                  P;                  R]P@                  ]PB                  .4      R 4       4       t"]P8                  P;                  R. R(O4      R 4       t#]P8                  P;                  RRR.4      R 4       t$]P8                  P;                  RRR.4      ]P8                  P;                  R]P@                  ]PB                  .4      R 4       4       t%]P8                  P;                  R. R)O4      R 4       t&]P8                  P;                  R. R(O4      R 4       t']P8                  P;                  RRR.4      R  4       t(]P8                  P;                  RRR.4      ]P8                  P;                  R]P@                  ]PB                  .4      R! 4       4       t)]P8                  PU                  R"4      ]P8                  P;                  R. R(O4      R# 4       4       t+R# )*    N)Pandas4Warning)Categorical	DataFrameGrouperSeries)get_groupby_method_argsab)keyc                     V ^,          # )    xs   &p/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/groupby/test_raises.py<lambda>r      s    !a%    T)strict)paramsc                     V P                   # Nparamrequests   &r   byr      s     ==r   Fc                     V P                   # r   r   r   s   &r   groupby_seriesr   )   s    ==r   c                  X    \        R . ROR. ROR\        ^	4      R\        R4      /4      p V # )r	   r
   cd	xyzwtyuio	   r$   r$   r$   r$   r   r   r   r   	   r&      r'   r'   r'   r'   r&   r&   )r   rangelistdfs    r   df_with_string_colr,   .   s7    	,,qk"		

B Ir   c                  z    \        R . ROR. ROR\        ^	4      R\        P                  ! R^^^
^^R4      /4      p V # )r	   r
   r    r!   i  i`= r#   r%   )r   r(   datetimer*   s    r   df_with_datetime_colr/   ;   sI    	,,q""4Ar2r6B		

B Ir   c                  f    \        R . ROR. ROR\        ^	4      R\        . RO. R	ORR7      /4      p V # )
r	   r
   r    r!   T
categoriesorderedr#   r%   	r	   r	   r	   r	   r
   r
   r
   r
   r    r	   r
   r    r!   )r   r(   r   r*   s    r   df_with_cat_colr6   H   s@    	,,q=/			

B Ir   c           	         \         P                  ! WgR R7      ;_uu_ 4        V fI   VR8X  d   \        W44      ! V!   MVR8X  d   VP                  ! V.VO5!   MVP                  ! V.VO5!   Mo\
        P                  ! WR7      ;_uu_ 4        VR8X  d   \        W44      ! V!   M0VR8X  d   VP                  ! V.VO5!   MVP                  ! V.VO5!   RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)F)matchcheck_stacklevelNmethodaggr8   )tmassert_produces_warninggetattrr;   	transformpytestraises)klassmsghowgbgroupby_funcargswarn_categorywarn_msgs   &&&&&&&&r   _call_and_checkrK   Y   s     
	#	#
 
 =h)40|+d+\1D1u00(?B-t4E\FF</$/LL55 1
 
 10
 
 
s%   A,C:AC'	C:'C72C::D	rE   r;   r@   c           
         Tp\        W64      pVP                  VR 7      pV'       d'   VR,          pVR8X  d   \        VR4      '       d   Q hR# / RR;bRR;bRR;bR\        R3bR	R;bR
R;bR\        \        3R3bR\        \        3R3bR\        \        3R3bR\        \        3R3bR\        R3bRR;bRR;bRR;bRR;bRR;bRR;b/ R\        \
        P                  ! R4      3bR\        \
        P                  ! R4      3bRR;bR R;bR!R;bR"\        R3bR#\        \
        P                  ! R$4      3bR%\        R&3bR'R;bR(\        R)3bR*R;bR+R;bR,\        R)3bR-\        R)3bR.\        R)3bR/R;bR0\        \
        P                  ! R14      3bCV,          w  rV'       d   VR<9   d   R2V R32p
VR=9   d   \        p	M{VR"8X  d&   VR,          P                  P                  R48X  d   R5p
MOVR8X  d&   VR,          P                  P                  R48X  d   R6p
M#VR>9   d   V
P                  R7R84      p
M	VR8X  d   R9p
VR8X  d
   \        pR:pMRpRp\        WWW7W4       R# )?r   r!   corrwithNall anybfillzCould not convertcountcumcountcummaxzH(function|cummax) is not (implemented|supported) for (this|object) dtypecumminzH(function|cummin) is not (implemented|supported) for (this|object) dtypecumprodzI(function|cumprod) is not (implemented|supported) for (this|object) dtypecumsumzH(function|cumsum) is not (implemented|supported) for (this|object) dtypediffunsupported operand typeffillfirstidxmaxidxminlastmaxmeanz-agg function failed [how->mean,dtype->object]medianz/agg function failed [how->median,dtype->object]minngroupnunique
pct_changeprodz-agg function failed [how->prod,dtype->object]quantilez4dtype 'object' does not support operation 'quantile'ranksemz!could not convert string to floatshiftsizeskewkurtstdsumvarz%agg function failed [how->var,dtype->z(dtype 'str' does not support operation ''pyarrowzBoperation 'truediv' not supported for dtype 'str' with dtype 'str'z>operation 'sub' not supported for dtype 'str' with dtype 'str'objectstrz1Cannot perform reduction 'mean' with string dtype'DataFrameGroupBy.corrwith is deprecatedNrP   )rg   ra   rb   rX   rW   ro   rj   rq   rm   rn   rh   )rj   ro   rm   rn   )rV   rU   )r   groupbyhasattr	TypeErrorNotImplementedErrorreescape
ValueErrordtypestoragereplacer   rK   )rE   r   r   rG   r,   using_infer_stringr+   rH   rF   rC   rD   rI   rJ   s   &&&&&&       r   test_groupby_raises_stringr   p   s    
B"<4D	r	BW:%r:....;z;z; 	; 	Y 34	;
 	; 	J; 	 ),V
; 	 ),V
; 	 ),W
;& 	 ),V
';. 	67/;0 	1;2 	3;4 	*5;6 	*7;8 	
9;: 	z;;< 	IIEF
=;D 	IIGH
E;L 	zM;N 	*O;P 	:Q;R 	y"<=S;T 	IIEF
U;\ 	Y VW];^ 	
_;` 	
?@a;b 	c;d 	
e;f 	@Ag;h 	@Ai;j 	
?@k;l 	zm;n 	II=>
o;v w;JEz  
 
 =\N!LC==!\)bgmm.C.Cy.P WCV#3(=(=(J SC11++h.CZ'ECz!&<E]Ur   c                     TpVP                  VR 7      pV'       d
   VR,          pR p\        P                  ! \        RR7      ;_uu_ 4        \	        WP4      ! V4       RRR4       R#   + '       g   i     R# ; i)rM   r!   c                     \        R 4      hTest error messagerz   r   s   &r   func,test_groupby_raises_string_udf.<locals>.func       ,--r   r   r<   Nrx   rA   rB   rz   r?   )rE   r   r   r,   r+   rF   r   s   &&&&   r   test_groupby_raises_string_udfr      sX    	B	r	BW. 
y(<	=	= 
>	=	=	=   A))A:	groupby_func_npc                 2   TpVP                  VR 7      pV'       d
   VR,          p\        P                  R\        P                  \        R3/V,          w  rV'       d+   V\        P                  J d   \        pRVP
                   R2p	\        WWVR4       R# )rM   r!   NzXCould not convert string .* to numeric|Cannot perform reduction 'mean' with string dtypezCannot perform reduction 'z' with string dtyperw   r   )rx   nprp   ra   rz   __name__rK   )
rE   r   r   r   r,   r   r+   rF   rC   rD   s
   &&&&&&    r   test_groupby_raises_string_npr      s     
B	r	BW 	

@
 JE bgg%E*?+C+C*DDWXE"=r   c           
         Tp\        W54      pVP                  VR 7      pV'       d'   VR,          pVR8X  d   \        VR4      '       d   Q hR# / R\        R3bR\        R3bRR4bR\        R
3bRR4bRR4bRR4bRR4bR\        R3bR\        R3bRR4bRR4bRR4bRR4bRR4bRR4bRR4b/ RR4bRR4bRR4bRR4bRR4bR\        R 3bR!\        R"3bR#R4bR$R4bR%R4bR&R4bR'R4bR(\        R)P	                  R*R+.4      3bR,\        R)P	                  R*R-.4      3bR.R4bR/\        R03bR1\        R23bCV,          w  rVR8X  d
   \
        p
R3pMRp
R	p\        WWW6W4       R# )5rM   r!   rN   NrO   z3'all' with datetime64 dtypes is no longer supportedrQ   z3'any' with datetime64 dtypes is no longer supportedrR   rP   z+cannot perform __mul__ with this index typerS   rT   rU   rV   rW   z4datetime64 type does not support operation 'cumprod'rX   z3datetime64 type does not support operation 'cumsum'rY   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   z/cannot perform __truediv__ with this index typerg   z1datetime64 type does not support operation 'prod'rh   ri   rj   rk   rl   rm   |z1dtype datetime64\[ns\] does not support operationz1datetime64 type does not support operation 'skew'rn   z1datetime64 type does not support operation 'kurt'ro   rp   z/datetime64 type does not support operation 'sumrq   z0datetime64 type does not support operation 'var'rv   rw   )r   rx   ry   rz   joinr   rK   )rE   r   r   rG   r/   r+   rH   rF   rC   rD   rI   rJ   s   &&&&&       r   test_groupby_raises_datetimer     s    
B"<4D	r	BW:%r:....3	PQ3	PQ3 	3 	Y MN	3
 	3 	J3 	*3 	*3 	IUV3 	9ST3 	
3 	3 	3 	*3 	*3  	
!3" 	z#3$ 	
%3& 	*'3( 	z)3* 	*+3, 	:-3. 	y"ST/30 	OP132 	J334 	
536 	z738 	93: 	
;3< 	HHHG
=3N 	HHHG
O3` 	za3b 		LMc3d 		MNe3f g3JEj z!&<E]Ur   c                     TpVP                  VR 7      pV'       d
   VR,          pR p\        P                  ! \        RR7      ;_uu_ 4        \	        WP4      ! V4       RRR4       R#   + '       g   i     R# ; i)rM   r!   c                     \        R 4      hr   r   r   s   &r   r   .test_groupby_raises_datetime_udf.<locals>.funck  r   r   r   r<   Nr   )rE   r   r   r/   r+   rF   r   s   &&&&   r    test_groupby_raises_datetime_udfr   c  sX    	B	r	BW. 
y(<	=	= 
>	=	=	=r   c                     TpVP                  VR 7      pV'       d
   VR,          p\        P                  \        \        P
                  ! R4      3\        P                  R/V,          w  rx\        WxWVR4       R# )rM   r!   z/datetime64[us] does not support operation 'sum'Nrw   r   )rx   r   rp   rz   r|   r}   ra   rK   )	rE   r   r   r   r/   r+   rF   rC   rD   s	   &&&&&    r   test_groupby_raises_datetime_npr   r  sq     
B	r	BW 	IIGH
 	 JE E"=r   r   c                     \        R . R	OR. R
OR\        ^	4      R\        P                  ! ^R7      /4      pVP	                  R R7      p\        \        RRVV . 4       R# )r	   r
   r    r!   )daysrM   z/timedelta64 type does not support .* operationsr:   Nr#   r%   )r   r(   r.   	timedeltarx   rK   rz   )r   r+   rF   s   &  r   test_groupby_raises_timedeltar     sb    	,,q##+		

B 
s	B9

r   c           
         Tp\        W54      pVP                  VR 7      pV'       d'   VR,          pVR8X  d   \        VR4      '       d   Q hR# / RR@bRR@bRR@bR\        R3bR	R@bR
R@bR\        \        3R3bR\        \        3R3bR\        \        3R3bR\        \        3R3bR\        R3bRR@bRR@bRR@bRR@bRR@bRR@b/ R\        RP                  RR.4      3bR\        RP                  R R!.4      3bR"R@bR#R@bR$R@bR%\        R&3bR'\        R(3bR)\        R*3bR+R@bR,\        RP                  R-R..4      3bR/R@bR0R@bR1\        RP                  R2R3.4      3bR4\        RP                  R5R6.4      3bR7\        RP                  R8R9.4      3bR:\        R;3bR<\        RP                  R=R>.4      3bCV,          w  rVR8X  d
   \        p
R?pMRp
Rp\        WWW6W4       R# )ArM   r!   rN   NrO   rP   rQ   rR   =unsupported operand type\(s\) for \*: 'Categorical' and 'int'rS   rT   rU   zz(category type does not support cummax operations|category dtype not supported|cummax is not supported for category dtype)rV   zz(category type does not support cummin operations|category dtype not supported|cummin is not supported for category dtype)rW   z|(category type does not support cumprod operations|category dtype not supported|cumprod is not supported for category dtype)rX   zz(category type does not support cumsum operations|category dtype not supported|cumsum is not supported for category dtype)rY   zDunsupported operand type\(s\) for -: 'Categorical' and 'Categorical'r[   r\   r]   r^   r_   r`   ra   r   z2'Categorical' .* does not support operation 'mean'2category dtype does not support aggregation 'mean'rb   z4'Categorical' .* does not support operation 'median'4category dtype does not support aggregation 'median'rc   rd   re   rf   zDunsupported operand type\(s\) for /: 'Categorical' and 'Categorical'rg   .category type does not support prod operationsrh   No matching signature foundri   rj   1'Categorical' .* does not support operation 'sem'1category dtype does not support aggregation 'sem'rk   rl   rm   0dtype category does not support operation 'skew'.category type does not support skew operationsrn   0dtype category does not support operation 'kurt'.category type does not support kurt operationsro   1'Categorical' .* does not support operation 'std'1category dtype does not support aggregation 'std'rp   -category type does not support sum operationsrq   1'Categorical' .* does not support operation 'var'1category dtype does not support aggregation 'var'rv   rw   )r   rx   ry   rz   r{   r   r   rK   )rE   r   r   rG   r6   r+   rH   rF   rC   rD   rI   rJ   s   &&&&&       r   test_groupby_raises_categoryr     s   
 
B"<4D	r	BW:%r:....xzxzx 	x 	L
	x 	x 	Jx 	 ),:
x  	 ),:
!x, 	 ),;
-x8 	 ),:
9xD 	S
ExL 	MxN 	OxP 	*QxR 	*SxT 	
UxV 	zWxX 	HHHH
Yxj 	HHJJ
kx| 	z}x~ 	*x@ 	:AxB 	S
CxJ 	LMKxL 	Y =>MxN 	
OxP 	HHGG
Qxb 	cxd 	
exf 	HHFD
gxx 	HHFD
yxJ 	HHGG
Kx\ 		JK]x^ 	HHGG
_xp qxJEt z!&<E]Ur   c                     TpVP                  VR 7      pV'       d
   VR,          pR p\        P                  ! \        RR7      ;_uu_ 4        \	        WP4      ! V4       RRR4       R#   + '       g   i     R# ; i)rM   r!   c                     \        R 4      hr   r   r   s   &r   r   .test_groupby_raises_category_udf.<locals>.func:  r   r   r   r<   Nr   )rE   r   r   r6   r+   rF   r   s   &&&&   r    test_groupby_raises_category_udfr   1  sZ     
B	r	BW. 
y(<	=	= 
>	=	=	=r   c                     TpVP                  VR 7      pV'       d
   VR,          p\        P                  \        R3\        P                  \        R3/V,          w  rx\        WxWVR4       R# )rM   r!   z/dtype category does not support operation 'sum'z0dtype category does not support operation 'mean'Nr   )rx   r   rp   rz   ra   rK   )	rE   r   r   r   r6   r+   rF   rC   rD   s	   &&&&&    r   test_groupby_raises_category_npr   A  sk     
B	r	BW 	MN
>
 JE E"=r   z$ignore:In a future version, the keysc           
         Tp\        . RDO. REORR7      VR &   \        W64      pVP                  WR7      pV'       d'   VR,          pVR8X  d   \        VR4      '       d   Q hR# V'       * ;'       de    \        ;QJ d4    R VP
                  P                  4        4       F  '       g   K   RM)	  RM%! R VP
                  P                  4        4       4      p	V R	8X  d   Rp	/ R
RFbRRFbRRFbR\        R3bRRFbRRFbR\        \        3R3bR\        \        3R3bR\        \        3R3bR\        \        3R3bR\        R3bRRFbRRFbRV	'       d	   \        R3MRFbRV	'       d	   \        R3MRFbR RFbR!RFb/ R"\        R#3bR$\        R%3bR&RFbR'RFbR(RFbR)\        R3bR*\        R+3bR,\        R-3bR.RFbR/\        R0P                  R1R2.4      3bR3RFbR4RFbR5\        R0P                  R6R7.4      3bR8\        R0P                  R9R:.4      3bR;\        R0P                  R<R=.4      3bR>\        R?3bR@\        R0P                  RARB.4      3bCV,          w  rVR8X  d
   \        pRCpMRpRp\        WWW7W4       R# )Gr	   r!   Tr1   )r   observedrN   Nc              3   8   "   T F  qP                   x  K  	  R # 5ir   )empty).0groups   & r   	<genexpr>;test_groupby_raises_category_on_category.<locals>.<genexpr>r  s     'TASASs   Fr@   rO   rP   rQ   rR   r   rS   rT   rU   zz(cummax is not supported for category dtype|category dtype not supported|category type does not support cummax operations)rV   zz(cummin is not supported for category dtype|category dtype not supported|category type does not support cummin operations)rW   z|(cumprod is not supported for category dtype|category dtype not supported|category type does not support cumprod operations)rX   zz(cumsum is not supported for category dtype|category dtype not supported|category type does not support cumsum operations)rY   rZ   r[   r\   r]   z(empty group due to unobserved categoriesr^   r_   r`   ra   r   rb   r   rc   rd   re   rf   rg   r   rh   r   ri   rj   r   r   r   rk   rl   rm   r   r   rn   r   r   ro   r   r   rp   r   rq   r   r   rv   r4   r5   rw   )r   r   rx   ry   rQ   groupsvaluesrz   r{   r~   r   r   rK   )rE   r   r   rG   r   r6   r+   rH   rF   empty_groupsrC   rD   rI   rJ   s   &&&&&&        r   (test_groupby_raises_category_on_categoryr   W  s    
B5'BsG
 #<4D	r	-BW:%r:....<TTCC'TAQAQAS'TCCC'TAQAQAS'T$TL
kfzfzf 	f 	L
	f 	f 	Jf 	 ),@
f  	 ),@
!f, 	 ),A
-f8 	 ),@
9fD 	67EfF 	GfH 	IfJ 	 IJOfP 	 IJUfV 	
WfX 	zYfZ 	PQ[f\ 	9TU]f^ 	z_f` 	*afb 	:cfd 	y"<=eff 	LMgfh 	Y =>ifj 	
kfl 	HHGG
mf~ 	f@ 	
AfB 	HHDF
CfT 	HHDF
Uff 	HHGG
gfx 		JKyfz 	HHGG
{fL MfJEP z!&<E]Ur   )	r   r   r   r$   r   r   r   r&   r&   r#   r%   rw   )r:   r;   r@   )rg   rW   rm   rn   rq   ),r.   r|   numpyr   rA   pandas.errorsr   pandasr   r   r   r   pandas._testing_testingr=   pandas.tests.groupbyr   fixturearraydictzipr(   r   r   r,   r/   r6   rK   markparametrizer   r   rp   ra   r   r   r   r   r   r   r   r   filterwarningsr   r   r   r   <module>r      sv  
  	   (   8 		c
C#
,-Sq6tDE*+	+	,f5P.QR e}% & 	 	 	 	   6.  >?qV @qVh  45 6  45*RVVRWW,=>> ? 6>@  >?IV @IVX  45 6  45*RVVRWW,=>> ? 6>( !KL M*  >?OV @OVd  45 6  45*RVVRWW,=>> ? 6>( BC >?LV @ DLVr   