hyb
2025-11-18 7539e6f48c75dcaeb808359cccfd1c0d0d182ce8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Ë
oñúhÈ ãóÒ—dZddlmZddlmZddlZddlZddlm    Z    m
Z
ddl m Z ddl mZddlmZddlmZdd    lmZdd
lmZerddlZej4d d g¬ «d„«Zej4d„«Zej4d„«Zej4d„«Zej4d„«Zej4d„«Z Gd„dejB«Z"Gd„dejF«Z$y)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ó.—t|j¬«S)N©Úfreq)r    Úparam)Úrequests úUH:\Change_password\venv_build\Lib\site-packages\pandas/tests/extension/test_period.pyÚdtyper(s€ä ˜GŸM™MÔ *Ð*ócóD—ttjdd«|¬«S)Ni²i©r)r ÚnpÚarangers rÚdatar-s€ä ”r—y‘y  tÓ,°EÔ :Ð:rcó —tgd¢|¬«S)N)éâéãéárr
rs rÚdata_for_sortingr!2s€ä Ò)°Ô 7Ð7rcó(—ttdg|¬«S)Nr r©r rrs rÚ data_missingr$7s€ä œ˜d|¨5Ô 1Ð1rcó*—tdtdg|¬«S)Nrr rr#rs rÚdata_missing_for_sortingr&<s€ä ˜œd DÐ)°Ô 7Ð7rc
óD—d}t}d}d}t||||||||g|¬«S)Nrr rr)rr )rÚBÚNAÚAÚCs     rÚdata_for_groupingr,As4€à €AÜ     €BØ €AØ €AÜ ˜˜1˜b " a¨¨A¨qÐ1¸Ô ?Ð?rcó·—eZdZˆfd„Zd d„Zd d„Zdˆfd„ Zejjdddg«ˆfd„«Z
ejjd    d
d g«d „«Z ˆxZ S)ÚTestPeriodArraycó0•—|dvryt‰||||«S)N)Ú__sub__Ú__rsub__)ÚsuperÚ_get_expected_exception)ÚselfÚop_nameÚobjÚotherÚ    __class__s    €rr3z'TestPeriodArray._get_expected_exceptionKs#ø€Ø Ð-Ñ -ØÜ‰wÑ.¨w¸¸UÓCÐCrcó
—|dvS)N)ÚcumminÚcummax©)r4Úserr5s   rÚ_supports_accumulationz&TestPeriodArray._supports_accumulationPs€ØÐ.Ð.Ð.rcó
—|dvS)N)ÚminÚmaxÚmedianr<)r4r6r5s   rÚ_supports_reductionz#TestPeriodArray._supports_reductionSs€ØÐ2Ð2Ð2rcó@•—|dk(rˆt||«}|jd«}t||«}||¬«}||¬«}|jj}    t    j
t |«|    ¬«}tj||«yt‰
|)|||«S)NrBÚint64)Úskipnar) ÚgetattrÚastyperrrÚ _from_ordinalÚintÚtmÚassert_almost_equalr2Ú check_reduce) r4r=r5rFÚres_opÚaltÚexp_opÚresultÚexpectedrr8s           €rrMzTestPeriodArray.check_reduceVsø€Ø hÒ Ü˜S 'Ó*ˆFà—*‘*˜WÓ%ˆCä˜S 'Ó*ˆFÙ 6Ô*ˆFÙ VÔ,ˆHð—9‘9—>‘>ˆDÜ×+Ñ+¬C°«MÀÔEˆHÜ × "Ñ " 6¨8Õ 4ô‘7Ñ'¨¨W°fÓ=Ð =rÚperiodsééþÿÿÿcóȕ—t«r;tr5tjtd¬«5t
‰|||«ddd«yt
‰|||«y#1swYyxYw)NF)Úcheck_stacklevel)rrrKÚassert_produces_warningÚRuntimeWarningr2Ú    test_diff)r4rrSr8s   €rrZzTestPeriodArray.test_diffhsVø€ä Ô  Õ%7Ü×+Ñ+¬NÈUÔSñ 1Ü‘Ñ! $¨Ô0÷ 1ð 1ô ‰GÑ ˜d GÕ ,÷ 1ð 1ús ­AÁA!Ú    na_actionNÚignorecóX—|jd„|¬«}tj||«y)Ncó—|S)Nr<)Úxs rú<lambda>z*TestPeriodArray.test_map.<locals>.<lambda>rs€ A€r)r[)ÚmaprKÚassert_extension_array_equal)r4rr[rQs    rÚtest_mapzTestPeriodArray.test_mapps$€à—‘™+°Ó;ˆÜ
×'Ñ'¨°Õ5r)r5ÚstrÚreturnÚbool)r=z    pd.Seriesr5rdrFrf) Ú__name__Ú
__module__Ú __qualname__r3r>rCrMÚpytestÚmarkÚ parametrizerZrcÚ __classcell__)r8s@rr.r.Jskø„ôDó
/ó3õ>ð$ ‡[[×јY¨¨B¨Ó0ó-ó1ð-ð ‡[[×ј[¨4°Ð*:Ó;ñ6ó<ô6rr.có —eZdZy)Ú Test2DCompatN)rgrhrir<rrrorovs„Ørro)%Ú__doc__Ú
__future__rÚtypingrÚnumpyrrjÚ pandas._libsrrÚ pandas.compatrÚpandas.compat.numpyrÚpandas.core.dtypes.dtypesr    Úpandas._testingÚ_testingrKÚpandas.core.arraysr Úpandas.tests.extensionr ÚpandasÚpdÚfixturerrr!r$r&r,ÚExtensionTestsr.ÚNDArrayBacked2DTestsror<rrú<module>rsùðñõ#å ãÛ ÷õ.Ý2å1åÝ*Ý'áÛð€‡˜˜T{Ô#ñ+ó$ð+ð‡ñ;óð;ð‡ñ8óð8ð‡ñ2óð2ð‡ñ8óð8ð‡ñ@óð@ô)6d×)Ñ)ô)6ôX    4×,Ñ,õ    r