hyb
2025-11-04 668edf874b4f77214a8ff4513e60e3c1a973f532
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Ë
oñúhã
ó.—ddlZddlZddlZddlmZejjd«Z
ejd«Z ddl mZejDcgc]}ej gd¢|¬«‘Œc}Zeej$Dcgc]}ej gd¢|¬«‘Œc}z Zeej gd¢d    ¬«gz Zej&eeDcgc]}|j(j*‘Œc}¬
«d „«Zd „Zd „Zd„Zd„Zd„Zd„Zej&d„«Zd„Zejj?de jAd«e jCe jAd«e jAd«g«g«d„«Z"d„Z#ycc}wcc}wcc}w)éNz=ignore:Passing a BlockManager to DataFrame:DeprecationWarningÚpyarrow)Úpyarrow_array_to_numpy_and_mask)éééN©Údtype)gš™™™™™¹?gš™™™™™É?g333333Ó?N)TFTNÚboolean)ÚparamsÚidscó—|jS)zi
    Fixture returning parametrized array from given dtype, including integer,
    float and boolean
    )Úparam)Úrequests ú_H:\Change_password\venv_build\Lib\site-packages\pandas/tests/arrays/masked/test_arrow_compat.pyÚdatars€ð =‰=Ðócóú—tj|«}tj|jtd¬«tj    |j
j «¬«}|j|«sJ‚y)N)Úna_value©Útype)ÚpaÚarrayÚto_numpyÚobjectÚfrom_numpy_dtyper    Ú numpy_dtypeÚequals)rÚarrÚexpecteds   rÚtest_arrow_arrayr s^€Ü
(‰(4‹.€C܏x‰xØ  ‰ ”f tˆ Ó,Ü ×  Ñ   §¡×!7Ñ!7Ó 8ðó€Hð :‰:hÔ ÐÑ rcó^—tjd|i«}tj|«}|j    d«j
t |jj«k(sJ‚|j«}|dj|jk(sJ‚tj||«y)NÚa) ÚpdÚ    DataFramerÚtableÚfieldrÚstrr    rÚ    to_pandasÚtmÚassert_frame_equal©rÚdfr%Úresults    rÚtest_arrow_roundtripr.'s…€Ü     ‰s˜DkÓ    "€BÜ H‰HR‹L€EØ ;‰;sÓ ×  Ñ  ¤C¨¯
©
×(>Ñ(>Ó$?Ò ?Ð?Ð ?à _‰_Ó €FØ #‰;× Ñ  §
¡
Ò *Ð*Ð *Ü×ј& "Õ%rcón—d„}tjgd¢tj«¬«}tjgd¢tj«¬«}tjgd¢tj    «¬«}tj
j |||ggd¢«}|j|¬«}tjgd¢d¬    «}tjgd¢d
¬    «}tjgd¢d
¬    «}tj|||dœ«}    tj||    «y) NcóЗtjj|«rtj«Stjj |«rtj «Sy)N)rÚtypesÚ
is_booleanr#Ú BooleanDtypeÚ
is_integerÚ
Int64Dtype)Ú
arrow_types rÚ types_mapperz<test_dataframe_from_arrow_types_mapper.<locals>.types_mapper2sD€Ü 8‰8× Ñ ˜zÔ *Ü—?‘?Ó$Ð $Ü X‰X×  Ñ   Ô ,Ü—=‘=“?Ð "ð-r)TNFr)rNr)éÿÿÿÿré)ÚboolsÚintsÚ
small_ints)r7r
rÚInt64) rrÚbool_Úint64Úint8Ú RecordBatchÚ from_arraysr(r#ÚSeriesr$r)r*)
r7Ú bools_arrayÚ
ints_arrayÚsmall_ints_arrayÚ record_batchr-r:r;r<rs
          rÚ&test_dataframe_from_arrow_types_mapperrH1sà€ò#ô —(‘(Ò.´R·X±X³Z(Ó@€KÜ—‘š,¬R¯X©X«ZÓ8€JÜ—x‘x¢
´·±³xÓ;ÐÜ—>‘>×-Ñ-Ø    jÐ"2Ð3Ò5Tó€Lð× #Ñ #°Ð #Ó >€FÜ I‰IÒ)°Ô ;€EÜ 9‰9’\¨Ô 1€DÜ—‘š:¨WÔ5€J܏|‰| e°TÈÑTÓU€HÜ×ј& (Õ+rcó—tjd|ddi«}tj|«}|j    d«j
t |jj«k(sJ‚tjtjg|j    d«j
¬«g|j¬«}|j«}|dj|jk(sJ‚tj||«y)Nr"rr)Úschema)r#r$rr%r&rr'r    rÚ chunked_arrayrJr(r)r*r+s    rÚ test_arrow_load_from_zero_chunksrLFs΀ô
‰s˜D  1˜IÐ&Ó    '€BÜ H‰HR‹L€EØ ;‰;sÓ ×  Ñ  ¤C¨¯
©
×(>Ñ(>Ó$?Ò ?Ð?Ð ?Ü H‰HÜ     ×    Ñ    ˜" 5§;¡;¨sÓ#3×#8Ñ#8Р   Ó    9Ð:À5Ç<Á<ð ó €Eð_‰_Ó €FØ #‰;× Ñ  §
¡
Ò *Ð*Ð *Ü×ј& "Õ%rcóڗtj«}|jtj    gd¢d¬««}tjgd¢d¬«}t j ||«y)N)rrréNr?rÚUInt32r)r#Ú UInt32DtypeÚ__from_arrow__rrr)Úassert_extension_array_equal)r    r-rs   rÚtest_arrow_from_arrow_uintrSTsO€ô N‰NÓ €EØ × !Ñ !¤"§(¡(Ò+=ÀG (Ó"LÓ M€F܏x‰xÒ*°(Ô;€Hä×#Ñ# F¨HÕ5rcó—tjd|i«}tj|«}|j    dd«j «}|j ddjd¬«}tj||«|j|d«}tj|«}|j    dd«j «}|j ddjd¬«}tj||«y)Nr"rT)Údropr) r#r$rr%Úslicer(ÚilocÚ reset_indexr)r*Úfillna)rr,r%r-rÚdf2s      rÚtest_arrow_slicedr[_sЀô
‰s˜DkÓ    "€BÜ H‰HR‹L€EØ [‰[˜˜DÓ !× +Ñ +Ó -€F؏w‰wqrˆ{×&Ñ&¨DÐ&Ó1€HÜ×ј& (Ô+ð )‰)D˜‘GÓ
€CÜ H‰HS‹M€EØ [‰[˜˜DÓ !× +Ñ +Ó -€F؏x‰x˜˜ˆ|×'Ñ'¨TÐ'Ó2€HÜ×ј& (Õ+rcóô—tj|«}tj|«}tj    gd¢|¬«}tjgd¢|¬«}tjgd¢«}||||fS)zt
    Fixture returning actual and expected dtype, pandas and numpy arrays and
    mask from a given numpy dtype
    )rrrNr)rrrr)TTTF)Únpr    rrr)Úany_real_numpy_dtypeÚnp_dtypeÚpa_typeÚpa_arrayÚ np_expectedÚ mask_expecteds      rÚnp_dtype_to_arraysrdpsg€ô x‰xÐ,Ó-€HÜ×!Ñ! (Ó+€Gôx‰xš¨gˆxÓ6€Hô—(‘(š9¨HÔ5€KÜ—H‘HÒ6Ó7€MØ X˜{¨MÐ 9Ð9rcóª—|\}}}}t||«\}}tj|dd|«tj||«|j«d}|j«d}|j«dj    «}    t
j |    dz«}
t
jj|jt|«||
g|j¬«} | j«t| |«\}}tj|dd|«tj||«d|jjdzz} t
j | |    z«} t
j d«}t
jj|jt|«|| g|jdz¬«}|j«t||«\}}tj|dd|«tj||«tjg|¬    «}tjgtj ¬    «}t
jj|jd||g|j¬«}|j«t||«\}}tj|dd|«tj||«y)
a&
    Test conversion from pyarrow array to numpy array.
 
    Modifies the pyarrow buffer to contain padding and offset, which are
    considered valid buffers by pyarrow.
 
    Also tests empty pyarrow arrays with non empty buffers.
    See https://github.com/pandas-dev/pandas/issues/40896
    Nrrró)rÚlengthÚbuffersÚoffsetéór)rr)Úassert_numpy_array_equalrhÚ
to_pybytesrÚ    py_bufferÚArrayÚ from_buffersrÚlenriÚvalidateÚ    bit_widthr]rr>)rdr_rarbrcrÚmaskÚ mask_bufferÚ data_bufferÚdata_buffer_bytesÚdata_buffer_trailÚpa_array_trailriÚdata_buffer_offsetÚmask_buffer_offsetÚpa_array_offsetÚnp_expected_emptyÚmask_expected_emptys                  rÚ$test_pyarrow_array_to_numpy_and_maskr‚s}€ð6HÑ2€Hˆh˜  ]Ü0°¸8ÓDJ€Dˆ$Ü×Ñ  R a ¨+Ô6Ü×Ñ  mÔ4à×"Ñ"Ó$ QÑ'€KØ×"Ñ"Ó$ QÑ'€KØ ×(Ñ(Ó*¨1Ñ-×8Ñ8Ó:ÐôŸ ™ Ð%6¸Ñ%@ÓAÐÜ—X‘X×*Ñ*Ø ]‰]ܐ8‹}ØÐ/Ð0؏‰ð    +ó€Nð ×ÑÔÜ0°ÀÓJJ€Dˆ$Ü×Ñ  R a ¨+Ô6Ü×Ñ  mÔ4𘟠™ ×/Ñ/°1Ñ4Ñ 5€FÜŸ™ fÐ/@Ñ&@ÓAÐÜŸ™ gÓ.ÐÜ—h‘h×+Ñ+Ø ]‰]ܐ8‹}Ø#Ð%7Ð8؏‰ Ñ"ð    ,ó€Oð ×ÑÔÜ0°À(ÓKJ€Dˆ$Ü×Ñ  R a ¨+Ô6Ü×Ñ  mÔ4ôŸ™ ¨8Ô4ÐÜŸ(™( 2¬R¯X©XÔ6Ðä—h‘h×+Ñ+Ø ]‰]ØØ˜kÐ*؏‰ð    ,ó€Oð ×ÑÔÜ0°À(ÓKJ€Dˆ$Ü×Ñ  R a Ð*;Ô<Ü×Ñ Ð&9Õ:rré
rNécóš—|jj|«}|j«j«sJ‚t    |«dk(sJ‚y)Nr€)r    rQÚisnaÚallrq)rrÚress   rÚtest_from_arrow_nullr†Ás>€ð *‰*×
# CÓ
(€CØ 8‰8‹:>‰>Ô ÐÐ Ü ˆs‹8rŠ>Љ>rcóâ—tj|«jd«}tjt
d¬«5|j j|«ddd«y#1swYyxYw)NÚstring)Úmatch)rrÚcastÚpytestÚraisesÚ    TypeErrorr    rQ)rrs  rÚtest_from_arrow_type_errorrŽÊsS€ô (‰(4‹.×
˜hÓ
'€CÜ    ‰”y¨Ô    -ñ'ð     
‰
×!Ñ! #Ô&÷'÷'ñ'ús ÁA%Á%A.)$Únumpyr]r‹Úpandasr#Úpandas._testingÚ_testingr)ÚmarkÚfilterwarningsÚ
pytestmarkÚ importorskiprÚ%pandas.core.arrays.arrow._arrow_utilsrÚALL_INT_EA_DTYPESrÚarraysÚFLOAT_EA_DTYPESÚfixturer    Únamerr r.rHrLrSr[rdrÚ parametrizeÚnullsrKr†rŽ)r    r"s00rú<module>rŸsðÛÛ ãÝà [‰[× 'Ñ 'ØCó€
ð
€V×јÓ#€åQà>@×>RÑ>RÖ    S°Uˆ(ˆ"(‰(’?¨%Ö
0Ò    S€ØÀR×EWÑEWÖ
X¸Eˆ8ˆ28‰8Ò)°Ö 7Ò
XÑX€Øˆ8ˆ28‰8Ò-°YÔ ?Ð
@Ñ@€ð€‡v¸&Ö#A°Q A§G¡G§L£LÒ#AÔBñóCðò ò&ò,ò* &ò6ò,ð"‡ñ:óð:ò"<;ð~‡×ÑØ    ˆBH‰HR‹L˜"×*Ñ*¨B¯H©H°Q«K¸¿¹À!»Ð+EÓFÐ Góñóðó 'ùòu
TùÚ
Xùò$BsÁFÂF ÃF