
    Mh              	           S r SSKrSSKrSSKJr  SSKJr  SSKJ	r	  S r
S r\R                  R                  S\R                  " SS/S	S
9\R                  R!                  SS	S/S9/5      S 5       rg)a;  
Tests that apply to all groupby operation methods.

The only tests that should appear here are those that use the `groupby_func` fixture.
Even if it does use that fixture, prefer a more specific test file if it available
such as:

 - test_categorical
 - test_groupby_dropna
 - test_groupby_subclass
 - test_raises
    N)	DataFrame)get_groupby_method_argsc                 t   [        / / / S.5      R                  / SQ5      nUR                  / SQSS9n[        X 5      n[	        X5      nU S:X  a  [
        OS nSn[        R                  " XVS9   U" U6 R                  nS S S 5        UR                  n[        R                  " WU5        g ! , (       d  f       N2= f)NabcF)
group_keysfillna%DataFrameGroupBy.fillna is deprecatedmatch)
r   	set_indexgroupbygetattrr   FutureWarningtmassert_produces_warningindexassert_index_equal)	groupby_funcdfgbmethodargswarnwarn_msgresultexpecteds	            W/var/www/html/env/lib/python3.13/site-packages/pandas/tests/groupby/test_all_methods.py,test_multiindex_group_all_columns_when_emptyr!      s    	"2.	/	9	9/	JB	O	6BR&F"<4D(H4=$D6H		#	#D	9$$ 
:xxH&(+ 
:	9s   -B))
B7c                    US:X  a.  SnU R                  [        R                  R                  US95        [	        / SQ/ SQ/ SQ/[        S5      S9n[        X5      nUR                  S	US
9nUS:X  a  [        OS nSn[        R                  " XxS9   [        Xa5      " U6 n	S S S 5        UR                  / SQSS9n
[        X5      nU
R                  S	US
9nUS:X  a  [        OS nSn[        R                  " XxS9   [        X5      " U6 nS S S 5        US;  a  WR                  SS0S9n[        R                  " W	W5        g ! , (       d  f       N= f! , (       d  f       NN= f)Ncorrwithz:GH#50845 - corrwith fails when there are duplicate columns)reason)         )r%         )         abbcolumnsr   )as_indexr   r   r   r   r%   )axis)sizengroupcumcountr	   r   )applymarkerpytestmarkxfailr   listr   r   r   r   r   r   set_axisrenameassert_equal)requestr   r0   msgr   r   r   r   r   r   expected_dfexpected_argsexpected_gbr   s                 r    test_duplicate_columnsrB   %   s<   z!JFKK--S-9:	Iy)4d5k	JB"<4D	C(	+B(H4=$D6H		#	#D	9*D1 
: ++oA+6K+LFM%%cH%=K(H4=$D6H		#	#D	9;5}E 
:99??C:?6OOFH% 
:	9 
:	9s   D>8E>
E
Eidxr   foo)name)r   r   rF   bar)namesc                    U S;   a  [         R                  " SU  35        [        SS//US9nUR                  S/5      n[	        X5      nU S:X  a  [
        OS nSn[        R                  " XVS9   [        X05      " U6 nS S S 5        WR                  S	:X  d   e[        R                  " UR                  U5        g ! , (       d  f       NB= f)
N>   r2   r3   r4   zNot applicable for r%   r.   r   r   r   r   )r%   r*   )r6   skipr   r   r   r   r   r   r   shaper   r/   )r   rC   r   grp_byr   r   r   r   s           r    test_dup_labels_output_shaperM   >   s     55),89	QF8S	)BZZ_F"<4D(H4=$D6H		#	#D	9.5 
: <<6!!!&..#.	 
:	9s   .B99
C)__doc__r6   pandaspdr   pandas._testing_testingr   pandas.tests.groupbyr   r!   rB   r7   parametrizeIndex
MultiIndexfrom_tuplesrM        r    <module>rZ      s~        8,&2 	
#s%(
!!":5%.!Q//rY   