+
    xȇi+                       R t ^ RIHt ^ RIt^ RIHt ^ RIt^ RIt^ RI	H
t
 ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt R t]P:                  ! RR.R7      R 4       t]P:                  R 4       t]P:                  R 4       t ]P:                  R 4       t!]P:                  R 4       t"]P:                  R 4       t#]P:                  R 4       t$ ! R R]PJ                  4      t& ! R R]PN                  4      t(R t)R# )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/`.

)annotationsN)cast)HAS_PYARROW)StorageExtensionDtypeis_string_dtype)ArrowStringArrayStringDtype)string_dtype_highest_priority)basec                \   V'       g   V # V P                   P                  R 8w  d   V # \        P                  ! R 4      pV P                  p\        V4      ^,          pVP                  . VRV P                  OW4R P                  O4      pVP                  ^8X  g   Q hV P                  V4      # )pyarrowN)
dtypestoragepytestimportorskip	_pa_arraylenchunked_arraychunks
num_chunks_from_pyarrow_array)arrchunkedpaarrow_arraysplits   &&   r/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/extension/test_string.pymaybe_split_arrayr   &   s    
			i	'
			Y	'B--K!E""B+fu

$
$B{6':'A'ABK !!Q&&&"";//    TF)paramsc                    V P                   # N)param)requests   &r   r   r   7   s    ==r    c                "    V w  r\        WR 7      # ))r   na_valuer	   )string_dtype_argumentsr   r'   s   &  r   r   r   <   s    .Gw::r    c                   \         P                  P                  ^4      P                  \	        \
        P                  4      ^
R7      pV^ ,          V^,          8X  dJ   \         P                  P                  ^4      P                  \	        \
        P                  4      ^
R7      pK^  V P                  4       P                  W R7      p\        W14      # )   )sizer   )
nprandomdefault_rngchoiceliststringascii_lettersconstruct_array_type_from_sequencer   )r   r   stringsr   s   &&  r   datar7   B   s    ii##A&--d63G3G.Hr-RG
!*

"))''*11$v7K7K2LSU1V

$
$
&
5
5g
5
KCS**r    c                z    V P                  4       P                  \        P                  R.V R7      p\	        W!4      # )zLength 2 array with [NA, Valid]Ar,   r4   r5   pdNAr   r   r   r   s   && r   data_missingr>   L   s5     
$
$
&
5
5ruucl%
5
PCS**r    c                ^    V P                  4       P                  . ROV R7      p\        W!4      # )Br,   )r@   Cr9   )r4   r5   r   r=   s   && r   data_for_sortingrB   S   s+    

$
$
&
5
5oU
5
SCS**r    c                |    V P                  4       P                  R \        P                  R.V R7      p\	        W!4      # )r@   r9   r,   r:   r=   s   && r   data_missing_for_sortingrD   Y   s6    

$
$
&
5
5sBEE36Gu
5
UCS**r    c           
         V P                  4       P                  R R \        P                  \        P                  RRR R.V R7      p\	        W!4      # )r@   r9   rA   r,   r:   r=   s   && r   data_for_groupingrF   _   sK    

$
$
&
5
5	c255"%%c34E 6 C S**r    c                     a  ] tR t^gtV 3R ltV 3R ltR tV 3R ltV 3R ltV 3R lt	R t
V 3R ltV 3R	 ltR
 tR tR tR R ltR R ltR R ltR R ltR tV 3R ltV 3R ltV 3R ltV 3R ltRtV ;t# )TestStringArrayc                	   < \        \        V! ^4      4      4      P                  pVP                  R8X  d'   VP                  \
        P                  J d	   RV n        MRV n        \        SV `%  V4      # )r*   r   bool[pyarrow]bool)
nextiterr   r   r'   r;   r<   _combine_le_expected_dtypesupertest_combine_le)selfdata_repeatedr   	__class__s   && r   rP   TestStringArray.test_combine_leh   sX    T-*+,22==I%%..BEE*A.=D+.4D+w&}55r    c                	   < \         SV `  V4       VP                  \        P                  J d   VR VP
                   R28X  g   Q hR# VP
                  R8X  d   VR8X  g   Q hR# R# )zstring[]r   strN)rO   test_eq_with_strr'   r;   r<   r   )rQ   r   rS   s   &&r   rX    TestStringArray.test_eq_with_strp   sX     '>>RUU"gemm_A6666]]i'E>!> (r    c                	,    \        V4      '       g   Q hR # r#   r   )rQ   r   s   &&r   test_is_not_string_type'TestStringArray.test_is_not_string_typey   s     u%%%%r    c                	   < VP                   \        P                  J d7   V'       g/   \        V4      P	                  VP
                  4      pVR J g   Q hR# \        SV `  V4       R# )FN)r'   r-   nantypeis_dtypenamerO   test_is_dtype_from_name)rQ   r   using_infer_stringresultrS   s   &&& r   rb   'TestStringArray.test_is_dtype_from_name~   sG    >>RVV#,>%[))%**5FU?"?G+E2r    c                	.  < VP                   \        P                  J dS   V'       gK   \        P                  ! \
        R R7      ;_uu_ 4        VP                  VP                  4       RRR4       R# \        SV `%  V4       R#   + '       g   i     R# ; i)z Cannot construct a 'StringDtype'matchN)
r'   r-   r^   r   raises	TypeErrorconstruct_from_stringra   rO   #test_construct_from_string_own_name)rQ   r   rc   rS   s   &&&r   rl   3TestStringArray.test_construct_from_string_own_name   s_    >>RVV#,>y0RSS++EJJ7 TS G7> TSSs   BB	c                	   < VP                   P                  R 8X  d   \        P                  ! RR7       \        SV `  V4       R# r   /2D support not implemented for ArrowStringArrayreasonN)r   r   r   skiprO   	test_viewrQ   r7   rS   s   &&r   rt   TestStringArray.test_view   s/    ::*KKPQ$r    c                	    R # r#    rQ   r7   s   &&r   test_from_dtypeTestStringArray.test_from_dtype   s    r    c                	   < VP                   P                  R 8X  d   \        P                  ! RR7       \        SV `  V4       R# ro   )r   r   r   rs   rO   test_transposeru   s   &&r   r}   TestStringArray.test_transpose   s/    ::*KKPQt$r    c                	   < VP                   P                  R 8X  d   \        P                  ! RR7       \        SV `  V4       R# ro   )r   r   r   rs   rO   test_setitem_preserves_viewsru   s   &&r   r   ,TestStringArray.test_setitem_preserves_views   s/    ::*KKPQ,T2r    c                	f    VP                  4       pV^.,          p\        P                  ! W#4       R# )   N)dropnatmassert_extension_array_equal)rQ   r>   rd   expecteds   &&  r   test_dropna_array!TestStringArray.test_dropna_array   s*    $$&$
''9r    c                	    WP                  4       ( ,          pV^ ,          pVP                  V4      pW1Jg   Q h\        P                  ! W14       R# )    N)isnafillnar   r   )rQ   r7   validrd   s   &&  r   test_fillna_no_op_returns_copy.TestStringArray.test_fillna_no_op_returns_copy   sC    YY[L!QU#!!!
''5r    c                	4   VP                  4       pR Vn        VP                  V^,          4      pV^ ,          V^,          8X  g   Q h\        P                  ! W!4       VP
                  P                  R8X  d1   VP                  V^,          4      pV^ ,          V^,          8X  g   Q hMG\        P                  ! \        RR7      ;_uu_ 4        VP                  V^,          RR7       RRR4       \        P                  ! W!4       R#   + '       g   i     L(; i)Tr   zCannot modify read-only arrayrg   F)copyN)
r   	_readonlyr   r   r   r   r   r   ri   
ValueError)rQ   r>   r7   rd   s   &&  r   test_fillna_readonly$TestStringArray.test_fillna_readonly   s      " \!_-ayLO+++
''; ::*[[a1F!9Q///z1PQQLO%8 R
''; RQs   DD	c                    V ^8  d   QhRRRR/# )r*   op_namerW   returnz4type[Exception] | tuple[type[Exception], ...] | Nonerx   )formats   "r   __annotate__TestStringArray.__annotate__   s      	=r    c                	T    VR9   d   \         # VR9   d   \         # VR9   d   \         # R# )__mod__N)r   __rmod__
__divmod____rdivmod____pow____rpow__)__mul____rmul__)__truediv____rtruediv____floordiv____rfloordiv____sub____rsub__)rj   )rQ   r   objothers   &&&&r   _get_expected_exception'TestStringArray._get_expected_exception   s@      
 
 // 
 
 r    c               $    V ^8  d   QhRRRRRR/# r*   serz	pd.Seriesr   rW   r   rK   rx   )r   s   "r   r   r      s!     
 
y 
3 
4 
r    c                	    VR9   ;'       g4    VP                   P                  \        P                  J ;'       d    VR9   # )min)r   maxsum)anyall)r   r'   r-   r^   rQ   r   r   s   &&&r   _supports_reduction#TestStringArray._supports_reduction   sB    // 
 
II"&&( * *>)	
r    c               $    V ^8  d   QhRRRRRR/# r   rx   )r   s   "r   r   r      s!     9 9) 9c 9d 9r    c                	P    \        VP                  \        4      '       g   Q hVR9   # )cummin)r   cummaxcumsum)
isinstancer   r   r   s   &&&r   _supports_accumulation&TestStringArray._supports_accumulation   s&    #))%:;;;;888r    c                   V ^8  d   QhRR/# )r*   r   rW   rx   )r   s   "r   r   r      s     0 0c 0r    c                	   \        \        \        P                  ! V4      4      pVR9   dS   Tp\	        V\
        4      '       g   \        P                  ! V4      MRp\	        V\        4      '       d   \        WW4      pMEVP                  \        P                  J d   \        P                  pMVP                  R8X  d   RpMRpVP                  V4      # )__add__Nr   rJ   boolean)r   __radd__)r   r
   r   	get_dtyper   rW   r   r'   r-   r^   bool_r   astype)rQ   r   r   r   pointwise_resultr   cast_todtype_others   &&&&&   r   _cast_pointwise_result&TestStringArray._cast_pointwise_result   s    [",,s"34--G5?s5K5K",,u-QUK+{337K^^rvv%hhG]]i'%GG&&w//r    c                	X    \         P                  ! V4      pV P                  W1VR 4       R# )abcN)r;   Series_compare_other)rQ   r7   comparison_opr   s   &&& r   test_compare_scalar#TestStringArray.test_compare_scalar   s!    iioC}e<r    c                	&   < \         SV `  W4       R # r#   )rO   test_groupby_extension_apply)rQ   rF   groupby_apply_oprS   s   &&&r   r   ,TestStringArray.test_groupby_extension_apply   s    ,->Qr    c                	   < \        V! ^4      4      P                  pV'       gC   VP                  R8X  d2   \        P                  P                  RR7      pVP                  V4       \        SV `!  V4       R# )r   pythonmThe pointwise operation result will be inferred to string[nan, pyarrow], which does not match the input dtyperq   N)	rL   r   r   r   markxfailapplymarkerrO   test_combine_add)rQ   rR   rc   r%   r   r   rS   s   &&&&  r   r    TestStringArray.test_combine_add   sb    ]1%&,,!emmx&?;;$$M % D % /r    c                	4  < VP                   pV'       dt   VR 8X  dm   VP                  \        P                  J dO   \        '       g   VP
                  R8X  d2   \        P                  P                  RR7      pVP                  V4       \        SV `-  W4       R# )r   r   r   rq   N)r   r'   r;   r<   r   r   r   r   r   r   rO   test_arith_series_with_array)rQ   r7   all_arithmetic_operatorsrc   r%   r   r   rS   s   &&&&&  r   r   ,TestStringArray.test_arith_series_with_array  sw     

(J6"%%' : ;;$$M % D %,TLr    c                	   < V'       gM   VP                   P                  R 8X  d2   \        P                  P	                  RR7      pVP                  V4       \        SV `  V4       R# )r   zCasts to objectrq   N)r   r   r   r   r   r   rO   8test_loc_setitem_with_expansion_preserves_ea_index_dtype)rQ   r7   r%   rc   r   rS   s   &&&& r   r   HTestStringArray.test_loc_setitem_with_expansion_preserves_ea_index_dtype  sL     "djj&8&8H&D;;$$,=$>D%HNr    )rN   )__name__
__module____qualname____firstlineno__rP   rX   r[   rb   rl   rt   rz   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classcell__)rS   s   @r   rH   rH   g   su    6"&
3? 
%
3
:
6<&6
90=R0M$O Or    rH   c                  H    ] tR tRt]P
                  ! RR7      R 4       tRtR# )Test2DCompati  T)autousec                	d    \        V\        4      '       d   \        P                  ! R R7       R# R# )rp   rq   N)r   r   r   rs   ry   s   &&r   arrow_not_supported Test2DCompat.arrow_not_supported   s"    d,--KKPQ .r    rx   N)r   r   r   r   r   fixturer   r   rx   r    r   r   r     s    ^^D!R "Rr    r   c                @   V w  r#pV P                  . RO4      p\        P                  VR&   V'       d   \        P                  ! V4      pRp\        P
                  ! \        VR7      ;_uu_ 4        VP                  V4       RRR4       R#   + '       g   i     R# ; i)r*   zOsearchsorted requires array to be sorted, which is impossible with NAs present.rg   N)r*   r   r   )taker;   r<   r   r   ri   r   searchsorted)rB   	as_seriesbcar   msgs   &&     r    test_searchsorted_with_na_raisesr  &  sr    GA!


	
*CeeCGiin	0  
z	-	- 
.	-	-	-s   0BB	)*__doc__
__future__r   r2   typingr   numpyr-   r   pandas.compatr   pandas.core.dtypes.baser   pandasr;   pandas._testing_testingr   pandas.api.typesr   pandas.core.arraysr   pandas.core.arrays.string_r
   #pandas.tests.arithmetic.test_stringr   pandas.tests.extensionr   r   r   r   r   r7   r>   rB   rD   rF   ExtensionTestsrH   Dim2CompatTestsr   r  rx   r    r   <module>r     s    #     % 9   , / 2 M '0" e}% & ; ;
 + + + + + +
 + +
 + +uOd)) uOpR4'' Rr    