+
    yȇi              
       F   ^ RI t^ RIt^ RIt^ RIHt ]P                  P                  R4      t
]P                  ! R4      t^ RIHt ]P                   U u. uF  p ]P!                  . ROV R7      NK  	  up t]]P$                   U u. uF  p ]P!                  . ROV R7      NK  	  up ,          t]]P                   ! . RORR7      .,          t]P&                  ! ]] Uu. uF  qP(                  P*                  NK  	  upR7      R 4       tR	 tR
 tR tR tR tR t]P&                  R 4       tR t]P                  P?                  R]PA                  ^
4      ]PC                  ]PA                  ^4      ]PA                  ^4      .4      .4      R 4       t"R t#R# u up i u up i u upi )    Nz=ignore:Passing a BlockManager to DataFrame:DeprecationWarningpyarrow)pyarrow_array_to_numpy_and_maskdtypeboolean)paramsidsc                    V P                   # )z]
Fixture returning parametrized array from given dtype, including integer,
float and boolean
)param)requests   &|/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/arrays/masked/test_arrow_compat.pydatar      s     ==    c                    \         P                  V 4      p\         P                  V P                  \        R R7      \         P	                  V P
                  P                  4      R7      pVP                  V4      '       g   Q hR # )N)na_valuetype)paarrayto_numpyobjectfrom_numpy_dtyper   numpy_dtypeequals)r   arrexpecteds   &  r   test_arrow_arrayr      sa    
((4.Cxxft,  !7!78  H ::hr   c                 r   \         P                  ! R V /4      p\        P                  V4      pVP	                  R 4      P
                  \        V P                  P                  4      8X  g   Q hVP                  4       pVR ,          P                  V P                  8X  g   Q h\        P                  ! W14       R# )aN)pd	DataFramer   tablefieldr   strr   r   	to_pandastmassert_frame_equalr   dfr"   results   &   r   test_arrow_roundtripr+   '   s    	sDk	"BHHRLE;;s  C

(>(>$????__F#;

***&%r   c                  z   R  p \         P                  . R
O\         P                  4       R7      p\         P                  . RO\         P                  4       R7      p\         P                  . RO\         P	                  4       R7      p\         P
                  P                  WV.. RO4      pVP                  V R7      p\        P                  ! . R
ORR7      p\        P                  ! . ROR	R7      p\        P                  ! . ROR	R7      p\        P                  ! RVRVRV/4      p	\        P                  ! WY4       R# )c                     \         P                  P                  V 4      '       d   \        P                  ! 4       # \         P                  P                  V 4      '       d   \        P                  ! 4       # R # )N)r   types
is_booleanr    BooleanDtype
is_integer
Int64Dtype)
arrow_types   &r   types_mapper<test_dataframe_from_arrow_types_mapper.<locals>.types_mapper2   sJ    88z**??$$XX  ,,==?" -r   Nr   boolsints
small_ints)r4   r   r   Int64)TNF)   N   )r      )r6   r7   r8   )r   r   bool_int64int8RecordBatchfrom_arraysr%   r    Seriesr!   r&   r'   )
r4   bools_array
ints_arraysmall_ints_arrayrecord_batchr*   r6   r7   r8   r   s
             r   &test_dataframe_from_arrow_types_mapperrH   1   s    # ((.RXXZ(@K,RXXZ8Jxx
x;>>--	"235TL ###>FII);E99\1D:W5J||WeVT<TUH&+r   c                     \         P                  ! R V R,          /4      p\        P                  V4      pVP	                  R 4      P
                  \        V P                  P                  4      8X  g   Q h\        P                  \        P                  . VP	                  R 4      P
                  R7      .VP                  R7      pVP                  4       pVR ,          P                  V P                  8X  g   Q h\        P                  ! W14       R# )r   :r   r   Nr   )schemaN)r    r!   r   r"   r#   r   r$   r   r   chunked_arrayrJ   r%   r&   r'   r(   s   &   r    test_arrow_load_from_zero_chunksrL   F   s     
sDI&	'BHHRLE;;s  C

(>(>$????HH			"5;;s#3#8#8		9:5<<  E __F#;

***&%r   c                      \         P                  ! 4       p V P                  \        P	                  . RORR7      4      p\         P                  ! . RORR7      p\
        P                  ! W4       R# )r:   Nr?   r   UInt32r   )r:   r;         N)r    UInt32Dtype__from_arrow__r   r   r&   assert_extension_array_equal)r   r*   r   s      r   test_arrow_from_arrow_uintrT   T   sM     NNE!!"((+=G("LMFxx*(;H##F5r   c                    \         P                  ! R V /4      p\        P                  V4      pVP	                  ^R4      P                  4       pVP                  R,          P                  RR7      p\        P                  ! W44       VP                  V ^ ,          4      p\        P                  V4      pVP	                  ^R4      P                  4       pVP                  R,          P                  RR7      p\        P                  ! W44       R# )r   N:r;   NNT)drop)r    r!   r   r"   slicer%   ilocreset_indexr&   r'   fillna)r   r)   r"   r*   r   df2s   &     r   test_arrow_slicedr\   _   s     
sDk	"BHHRLE[[D!++-Fwwr{&&D&1H&+ ))DG
CHHSME[[D!++-Fxx|''T'2H&+r   c                    \         P                  ! V 4      p\        P                  V4      p\        P	                  . ROVR7      p\         P                  ! . ROVR7      p\         P                  ! . RO4      pWWE3# )zh
Fixture returning actual and expected dtype, pandas and numpy arrays and
mask from a given numpy dtype
r   r   )r   r:   r;   N)r   r:   r;   )TTTF)npr   r   r   r   )any_real_numpy_dtypenp_dtypepa_typepa_arraynp_expectedmask_expecteds   &     r   np_dtype_to_arraysre   p   sc     xx,-H!!(+G xxgx6H ((9H5KHH67M{99r   c                   V w  rr4\        W!4      w  rV\        P                  ! VR,          V4       \        P                  ! Wd4       VP                  4       ^ ,          pVP                  4       ^,          pVP                  4       ^,          P	                  4       p	\
        P                  V	R,           4      p
\
        P                  P                  VP                  \        V4      Wz.VP                  R7      pVP                  4        \        W4      w  rV\        P                  ! VR,          V4       \        P                  ! Wd4       RVP                  P                  ^,          ,          p\
        P                  W,           4      p\
        P                  R4      p\
        P                  P                  VP                  \        V4      W.VP                  ^,           R7      pVP                  4        \        W4      w  rV\        P                  ! VR,          V4       \        P                  ! Wd4       \        P                  ! . VR7      p\        P                  ! . \        P                   R7      p\
        P                  P                  VP                  ^ Wx.VP                  R7      pVP                  4        \        W4      w  rV\        P                  ! VR,          V4       \        P                  ! VV4       R# )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
:NrO   N    )r   lengthbuffersoffset   r   N)r   r&   assert_numpy_array_equalri   
to_pybytesr   	py_bufferArrayfrom_buffersr   lenrj   validate	bit_widthr^   r   r>   )re   r`   rb   rc   rd   r   maskmask_bufferdata_bufferdata_buffer_bytesdata_buffer_trailpa_array_trailrj   data_buffer_offsetmask_buffer_offsetpa_array_offsetnp_expected_emptymask_expected_emptys   &                 r   $test_pyarrow_array_to_numpy_and_maskr      sP    6H2H0DJDR+64""$Q'K""$Q'K ((*1-88: %6%@AXX**]]8}0	 + N 0JJDR+64 //145Ff&@Ag.hh++]]8}#8"	 , O 0KJDR+64 84((2RXX6hh++]]*	 , O 0KJDR*;<&9:r   r   c                     V P                   P                  V4      pVP                  4       P                  4       '       g   Q h\	        V4      ^
8X  g   Q hR# )
   N)r   rR   isnaallrq   )r   r   ress   && r   test_from_arrow_nullr      sA     **
#
#C
(C88:>>s8r>>r   c                    \         P                  V 4      P                  R 4      p\        P                  ! \
        RR7      ;_uu_ 4        V P                  P                  V4       RRR4       R#   + '       g   i     R# ; i)stringN)match)r   r   castpytestraises	TypeErrorr   rR   )r   r   s   & r   test_from_arrow_type_errorr      sP     ((4.

h
'C	y	-	- 	

!!#& 
.	-	-	-s   	A//B 	)r:   r;   rO   N)g?g?g333333?N)TFTN)$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   namer   r   r+   rH   rL   rT   r\   re   r   parametrizenullsrK   r   r   )r   r   s   00r   <module>r      s      [[''C

 # Q>@>R>R	S>RU"((?%(
0>R	S REWEW
XEWE288)87EW
X X 288-Y?
@ @ v&#A&QGGLL&#AB C &,*&6," : :"<;~ 	BHHRL"**BHHQK!+EFG'u 
T
X $Bs   FFF
