
    Mh                       S r SSKJr  SSKJr  SSKrSSKrSSKJ	r	J
r
  SSKJr  SSKJr  SSKJr  SSKJr  SS	KJr  SS
KJr  \(       a  SSKr\R4                  " SS/S9S 5       r\R4                  S 5       r\R4                  S 5       r\R4                  S 5       r\R4                  S 5       r\R4                  S 5       r  " S S\RB                  5      r" " S S\RF                  5      r$g)aj  
This file contains a minimal set of tests for compliance with the extension
array interface test suite, and should contain no other tests.
The test suite for the full functionality of the array is located in
`pandas/tests/arrays/`.

The tests in this file are inherited from the BaseExtensionTests, and only
minimal tweaks should be applied to get the tests passing (by overwriting a
parent method).

Additional tests should either be added to one of the BaseExtensionTests
classes (if they are relevant for the extension interface for all dtypes), or
be added to the array-specific tests in `pandas/tests/arrays/`.

    )annotations)TYPE_CHECKINGN)PeriodiNaT)is_platform_windows)np_version_gte1p24)PeriodDtypePeriodArray)baseD2D)paramsc                (    [        U R                  S9$ )Nfreq)r	   param)requests    T/var/www/html/env/lib/python3.13/site-packages/pandas/tests/extension/test_period.pydtyper   (   s    GMM**    c                @    [        [        R                  " SS5      U S9$ )Ni  i  r   )r   nparanger   s    r   datar   -   s    ryyt,E::r   c                    [        / SQU S9$ )N)      r   r
   r   s    r   data_for_sortingr!   2   s    )77r   c                "    [        [        S/U S9$ )Nr    r   r   r   r   s    r   data_missingr$   7   s    d|511r   c                $    [        S[        S/U S9$ )Nr   r    r   r#   r   s    r   data_missing_for_sortingr&   <   s    dD)77r   c           
     6    Sn[         nSnSn[        XX"X3X/U S9$ )Nr   r    r   r   )r   r   )r   BNAACs        r   data_for_groupingr,   A   s,    A	BAAbaA1??r   c                     ^  \ rS rSrU 4S jrSS jrSS jrSU 4S jjr\R                  R                  SSS/5      U 4S	 j5       r\R                  R                  S
SS/5      S 5       rSrU =r$ )TestPeriodArrayJ   c                2   > US;   a  g [         TU ]  XU5      $ )N)__sub____rsub__)super_get_expected_exception)selfop_nameobjother	__class__s       r   r4   'TestPeriodArray._get_expected_exceptionK   s!    --w.wUCCr   c                    US;   $ )N)cummincummax )r5   serr6   s      r   _supports_accumulation&TestPeriodArray._supports_accumulationP   s    ...r   c                    US;   $ )N)minmaxmedianr>   )r5   r7   r6   s      r   _supports_reduction#TestPeriodArray._supports_reductionS   s    222r   c                ,  > US:X  a~  [        X5      nUR                  S5      n[        XR5      nU" US9nU" US9nUR                  R                  n	[        R
                  " [        U5      U	S9n[        R                  " Xx5        g [        T
U ])  XU5      $ )NrE   int64)skipnar   )getattrastyper   r   r   _from_ordinalinttmassert_almost_equalr3   check_reduce)r5   r?   r6   rJ   res_opaltexp_opresultexpectedr   r9   s             r   rQ   TestPeriodArray.check_reduceV   s    hS*F**W%CS*F6*FV,H 99>>D++CMEH""64 7'f==r   periods   c                   > [        5       (       a=  [        (       a2  [        R                  " [        SS9   [
        TU ]  X5        S S S 5        g [
        TU ]  X5        g ! , (       d  f       g = f)NF)check_stacklevel)r   r   rO   assert_produces_warningRuntimeWarningr3   	test_diff)r5   r   rX   r9   s      r   r_   TestPeriodArray.test_diffh   sQ      %7%7++NUS!$0 TS Gd, TSs   A
A,	na_actionNignorec                R    UR                  S US9n[        R                  " X15        g )Nc                    U $ )Nr>   )xs    r   <lambda>*TestPeriodArray.test_map.<locals>.<lambda>r   s    Ar   )ra   )maprO   assert_extension_array_equal)r5   r   ra   rU   s       r   test_mapTestPeriodArray.test_mapp   s"    +;
''5r   r>   )r6   strreturnbool)r?   z	pd.Seriesr6   rl   rJ   rn   )__name__
__module____qualname____firstlineno__r4   r@   rF   rQ   pytestmarkparametrizer_   rj   __static_attributes____classcell__)r9   s   @r   r.   r.   J   sk    D
/3>$ [[YB0- 1- [[[4*:;6 <6r   r.   c                      \ rS rSrSrg)Test2DCompatv   r>   N)ro   rp   rq   rr   rv   r>   r   r   ry   ry   v   s    r   ry   )%__doc__
__future__r   typingr   numpyr   rs   pandas._libsr   r   pandas.compatr   pandas.compat.numpyr   pandas.core.dtypes.dtypesr	   pandas._testing_testingrO   pandas.core.arraysr   pandas.tests.extensionr   pandaspdfixturer   r   r!   r$   r&   r,   ExtensionTestsr.   NDArrayBacked2DTestsry   r>   r   r   <module>r      s    #     . 2 1  * ' T{#+ $+ ; ; 8 8 2 2 8 8 @ @)6d)) )6X	4,, 	r   