+
    xȇi,              	       N   ^ RI t^ RIt^ RIHt ^ RIHt ^ RIHtH	t	H
t
 ^ RIHt ^ RIHt ]P                   P"                  .t]P&                  ! R4      t]P+                  ]P                   P-                  ]! ]P.                  4      ]! R4      8H  ;'       d    ]! 4       R]P.                   2R	7      4       R
 tR t]P                   P5                  R4      ]P                   P7                  RRR.4      R 4       4       t]P                   P5                  R4      ]P                   P7                  RRR.4      R 4       4       tR t]P                   P7                  RRR.RRRR.RR/.4      R 4       tR t R t!R t"R t#]P                   P5                  R4      R 4       t$R t%R  t&R! t'R# )"    N)is_platform_arm)NumbaUtilError)	DataFrameSeriesoption_context)Versionnumbaz0.61z&Segfaults on ARM platforms with numba )reasonc                     \         P                  ! R 4       R p \        R. R	OR. R
O/RR.R7      p\         P                  ! \        RR7      ;_uu_ 4        VP                  R4      P                  V R R7       RRR4       \         P                  ! \        RR7      ;_uu_ 4        VP                  R4      R,          P                  V R R7       RRR4       R#   + '       g   i     Lh; i  + '       g   i     R# ; i)r	   c                     V ^,           #     xs   &y/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/groupby/transform/test_numba.pyincorrect_function;test_correct_function_signature.<locals>.incorrect_function   s    1u    keydatacolumnszThe first 2matchengineNar   br    r         ?       @      @g      @g      @)pytestimportorskipr   raisesr   groupby	transform)r   r   s     r   test_correct_function_signaturer*      s    
  	)63LMD 
~]	;	;U%%&8%I 
< 
~]	;	;UF#--.@-Q 
<	; 
<	; 
<	;	;s   #C$*C+C(	+C<	c                  t   \         P                  ! R 4       R p R p\        R. ROR. RO/RR.R7      p\         P                  ! \        RR7      ;_uu_ 4        VP                  R4      P                  V R ^R7       R	R	R	4       \         P                  ! \        R
R7      ;_uu_ 4        VP                  R4      P                  VR ^R7       R	R	R	4       \         P                  ! \        RR7      ;_uu_ 4        VP                  R4      R,          P                  V R ^R7       R	R	R	4       \         P                  ! \        R
R7      ;_uu_ 4        VP                  R4      R,          P                  VR ^R7       R	R	R	4       \         P                  ! \        RR7      ;_uu_ 4        VP                  R4      P                  V R ^R7       R	R	R	4       VP                  R4      P                  VR ^R7      p\        P                  ! VR.,          ^,           V4       \         P                  ! \        RR7      ;_uu_ 4        VP                  R4      R,          P                  V R ^R7       R	R	R	4       VP                  R4      R,          P                  VR ^R7      p\        P                  ! VR,          ^,           V4       R	#   + '       g   i     ELP; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELR; i  + '       g   i     L; i)r	   c                    W,           # Nr   valuesindexr   s   &&$r   r   6test_check_nopython_kwargs.<locals>.incorrect_function.   
    zr   c                     W,           # r-   r   r.   s   &&&r   correct_function4test_check_nopython_kwargs.<locals>.correct_function1   r2   r   r   r   r   z8missing a required (keyword-only argument|argument): 'a'r   )r   r    Nz missing a required argument: 'a'znumba does not support)r   r   r   r!   )r%   r&   r   r'   	TypeErrorr(   r)   r   tmassert_frame_equalassert_series_equal)r   r4   r   actuals       r   test_check_nopython_kwargsr;   +   s   
  	)63LMD
 
S
 
 	U%%&8A%N
 
y(J	K	KU%%&6w!%L 
L 
S
 
 	UF#--.@TU-V
 
y(J	K	KUF#--.>wRS-T 
L 
~-E	F	FU%%&8A%N 
G\\% **+;Gq*QF$x.1,f5	~-E	F	FUF#--.@TU-V 
G\\% (22A 3 F 4<!+V43
 
 
 
L	K	K
 
 
 
L	K	K 
G	F	F
 
G	FsH   $K($K8+K++K?&$L?+L'K	K(	+K<	?L	L$	'L7	ignorejitTFc                 x   \         P                  ! R 4       R pV '       d   ^ RIpVP                  V4      p\	        ^ . RO^. RO/^ ^.R7      pRVRVRV/p	VP                  ^ VR7      p
V\        J d
   V
^,          p
V
P                  VR V	R7      pV
P                  R	 R
R7      p\        P                  ! W4       R# )r	   c                     V ^,           # r   r   r/   r0   s   &&r   func"test_numba_vs_cython.<locals>.func[       zr   Nr   nogilparallelnopython)as_indexr   engine_kwargsc                     V ^,           # r   r   r   s   &r   <lambda>&test_numba_vs_cython.<locals>.<lambda>m       1q5r   cythonr   r   r!   
r%   r&   r	   r=   r   r(   r   r)   r7   assert_equal)r=   frame_or_seriesrD   rE   rF   rG   rA   r	   r   rI   groupedresultexpecteds   &&&&&&       r   test_numba_vs_cythonrU   U   s       yy	
%q*CDqRSfD eZ:xPMll1xl0G& !*tG=QF   BHOOF%r   c                    \         P                  ! R 4       R pR pV '       d'   ^ RIpVP                  V4      pVP                  V4      p\	        ^ . RO^. RO/^ ^.R7      pRVRVRV/p	VP                  ^ 4      p
V\        J d
   V
^,          p
V
P                  VR V	R7      pV
P                  R	 R
R7      p\        P                  ! W4       V
P                  VR V	R7      pV
P                  R R
R7      p\        P                  ! W4       V
P                  VR V	R7      pV
P                  R R
R7      p\        P                  ! W4       R# )r	   c                     V ^,           # r   r   r@   s   &&r   func_1test_cache.<locals>.func_1y   rC   r   c                     V ^,          #    r   r@   s   &&r   func_2test_cache.<locals>.func_2|   rC   r   Nr   rD   rE   rF   rH   c                     V ^,           # r   r   r   s   &r   rK   test_cache.<locals>.<lambda>   rM   r   rN   r   c                     V ^,          # r[   r   r   s   &r   rK   r`      rM   r   c                     V ^,           # r   r   r   s   &r   rK   r`      rM   r   r   r!   rO   )r=   rQ   rD   rE   rF   rX   r]   r	   r   rI   rR   rS   rT   s   &&&&&        r   
test_cacherc   r   s;   
   6"6"	
%q*CDqRSfD eZ:xPMll1oG& !*vg]SF   BHOOF%vg]SF   BHOOF% vg]SF   BHOOF%r   c                  b   \         P                  ! R 4       R p \        ^ . RO^. RO/^ ^.R7      pVP                  ^ 4      pVP	                  V R R7      p\        RR4      ;_uu_ 4        VP	                  V RR7      pRRR4       \        P                  ! VX4       R#   + '       g   i     L); i)	r	   c                     V ^,           # r   r   r@   s   &&r   rX   &test_use_global_config.<locals>.func_1   rC   r   r   r   zcompute.use_numbaTNr   r!   )r%   r&   r   r(   r)   r   r7   r8   )rX   r   rR   rT   rS   s        r   test_use_global_configrg      s    
  	
%q*CDqRSfD ll1oG   8H	+T	2	2""6$"7 
3(F+ 
3	2s   )BB.	agg_funcminmaxBCsumc                    \         P                  ! R 4       Vw  r\        ^ . RO^. RO/^ ^.R7      pVP                  ^ 4      pVP                  ! V 3RR /VB pVP                  ! V 3RR/VB p\
        P                  ! WV4       V^,          P                  ! V 3RR /VB pV^,          P                  ! V 3RR/VB p\
        P                  ! WV4       R# )r	   r   r   rN   Nr   r!   )r%   r&   r   r(   r)   r7   r8   r9   )rh   numba_supported_reductionskwargsr   rR   rS   rT   s   &&     r   test_string_cython_vs_numbarq      s      1H	
%q*CDqRSfD ll1oGxBB6BF  E(EfEH&+QZ!!(E7EfEFqz##HHXHHH6,r   c                     \         P                  ! R 4       R p \        R. R	OR. R
O/4      pVP                  R4      R,          pVP	                  V ^R R7      p\        R.^,          RR7      p\        P                  ! W44       VP	                  V ^R R7      p\        R.^,          RR7      p\        P                  ! W44       R# )r	   c                 (    W) R  P                  4       # r-   )rm   )r/   r0   ns   &&&r   sum_last&test_args_not_cached.<locals>.sum_last   s    bc{  r   idr   r   r"   )namer#   N)r   r   r   r   )r   r   r   r   )r%   r&   r   r(   r)   r   r7   r9   )ru   df	grouped_xrS   rT   s        r   test_args_not_cachedr{      s    
 ! 
D,\:	;B

4 %I  1W =Fseaic*H6,  1W =Fseaic*H6,r   c                      \         P                  ! R 4       R p \        R. ROR. R	O/. R
OR7      pVP                  R4      P	                  V R R7      p\        . ROR.. R
OR7      p\
        P                  ! W#4       R# )r	   c                     V^,
          # r   r   r@   s   &&r   f+test_index_data_correctly_passed.<locals>.f   s    qyr   groupvr0   r   )r   r0   N)Ar   rk   )   r\      ))g       g      g      r%   r&   r   r(   r)   r7   r8   r~   ry   rS   rT   s       r    test_index_data_correctly_passedr      si    
  
G_c9=\	RBZZ **1W*=F+cU,OH&+r   c                  ,   \         P                  ! R 4       R p \        R. ROR. R	O/\        ^R
R
4      R7      pVP	                  R4      R,          P                  V R R7      p\        . RO\        ^R
R
4      RR7      p\        P                  ! W#4       R# )r	   c                     V # r-   r   r@   s   &&r   r~   1test_index_order_consistency_preserved.<locals>.f   s    r   valsr   r   r   )r0   rx   N)g        r"   r#   r$   )r   r   r   r   r   )	r%   r&   r   ranger(   r)   r   r7   r9   r   s       r   &test_index_order_consistency_preservedr      s    
  
	%w=U1bRTEU
B ZZ (221W2EF*%2r2BPH6,r   c                    aaa \         P                  ! R 4       RoRoRoVVV3R lp RSRSRS/p\        R. RO/4      pVP                  ^ R7      P	                  V R VR	7      p\        R. RO/4      p\
        P                  ! W44       RoRSRSRS/pVP                  ^ R7      P	                  V R VR	7      p\        R. RO/4      p\
        P                  ! W44       R
# )r	   TFc                 $   < SS,           S,           # r-   r   )r/   r0   rD   rF   rE   s   &&r   func_kwargs2test_engine_kwargs_not_cached.<locals>.func_kwargs   s    x(**r   rF   rD   rE   value)levelrH   N)r   r   r   )r#   r#   r#   )r"   r"   r"   r   )r   rI   ry   rS   rT   rD   rF   rE   s        @@@r   test_engine_kwargs_not_cachedr      s      EHH+  7E:xPM	GY'	(BZZaZ **G= + F '?34H&+E7E:xPMZZaZ **G= + F '?34H&+r   c                 F   \         P                  ! R 4       R p\        R^R^R^/.4      P                  RR.4      pRVRV RV/pVP	                  R4      P                  VR VR7      p\        R^R^RR	/.4      P                  RR.4      p\        P                  ! Wg4       R
# )r	   c                     ^# r   r   r@   s   &&r   
numba_func+test_multiindex_one_key.<locals>.numba_func      r   r   rk   rl   rF   rD   rE   rH   r"   N)r%   r&   r   	set_indexr(   r)   r7   r8   )rD   rE   rF   r   ry   rI   rS   rT   s   &&&     r   test_multiindex_one_keyr   
  s    
  
S!S!S!,-	.	8	8#s	DB7E:xPMZZ_&&7- ' F 333456@@#sLH&+r   c                 Z   \         P                  ! R 4       R p\        R^R^R^/.4      P                  RR.4      pRVRV RV/p\         P                  ! \
        RR	7      ;_uu_ 4        VP                  RR.4      P                  VR VR
7       RRR4       R#   + '       g   i     R# ; i)r	   c                     ^# r   r   r@   s   &&r   r   ;test_multiindex_multi_key_not_supported.<locals>.numba_func  r   r   r   rk   rl   rF   rD   rE   zmore than 1 grouping labelsr   rH   N)r%   r&   r   r   r'   NotImplementedErrorr(   r)   )rD   rE   rF   r   ry   rI   s   &&&   r   'test_multiindex_multi_key_not_supportedr     s    
  
S!S!S!,-	.	8	8#s	DB7E:xPM	*2O	P	P


C:((wm 	) 	
 
Q	P	P	Ps   )&BB*	c                    \         P                  ! R 4       V w  r\        R. ROR. R	OR\        P                  P                  ^4      P                  ^4      R\        P                  P                  ^4      P                  ^4      /4      pVP                  RR.4      pVP                  ! V3RR /VB pVP                  ! V3RR/VB p\        P                  ! WV4       R# )
r	   r   rk   rl   Dr   rN   Nfoobarr   r   r   r   r   r   oner   twothreer   r   r   r   r%   r&   r   nprandomdefault_rngstandard_normalr(   r)   r7   r8   )ro   	reductionrp   ry   gbres_aggexpected_aggs   &      r   test_multilabel_numba_vs_cythonr   (  s    
 2I	IM&&q)99!<&&q)99!<		

B 
S#J	Bll9?W??G<<	E(EfEL'0r   c                     \         P                  ! R 4       \        R. R
OR. ROR\        P                  P                  ^4      P                  ^4      R\        P                  P                  ^4      P                  ^4      /4      p V P                  RR.4      pVP                  R R R7      pVP                  R RR7      p\        P                  ! W#4       R	# )r	   r   rk   rl   r   c                     W P                  4       ,
          V P                  4       V P                  4       ,
          ,          # r-   ri   rj   r@   s   &&r   rK   5test_multilabel_udf_numba_vs_cython.<locals>.<lambda>E  s#    v

4

9TUr   r   c                     W P                  4       ,
          V P                  4       V P                  4       ,
          ,          # r-   r   r   s   &r   rK   r   I  s"    1uuw;1557QUUW#45r   rN   Nr   r   r   )ry   r   rS   rT   s       r   #test_multilabel_udf_numba_vs_cythonr   9  s    
 	IM&&q)99!<&&q)99!<		

B 
S#J	B\\U  F ||5h  H &+r   )(numpyr   r%   pandas.compatr   pandas.errorsr   pandasr   r   r   pandas._testing_testingr7   pandas.util.versionr   mark
single_cpu
pytestmarkr&   r	   appendskipif__version__r*   r;   filterwarningsparametrizerU   rc   rg   rq   r{   r   r   r   r   r   r   r   r   r   r   <module>r      s     ) ( 
  'kk$$%
G$ 
  
KK!!"gfo5KK/:K78I8I7JK  R"'5T H%u.& / &&4 H%u.#& / &#&L," %uenc5(IJ--"-$
,-,8 H%, &,
1",r   