+
    xȇiV$                       R t ^ RIHt ^ RIHtHt ^ RIt^ RIt^ RIt^ RI	t	^ RI
HtHt ^ RIt^ RIHt ^ RIHtHtHt ^ RIt^ RIHtHt ^ RIHtHt ]'       d   ^ R	IHt ^ R
IH t   ! R R]4      t! ! R R]4      t"R R lt#R# )a  
Test extension array for storing nested data in a pandas container.

The JSONArray stores lists of dictionaries. The storage mechanism is a list,
not an ndarray.

Note
----
We currently store lists of UserDicts. Pandas has a few places
internally that specifically check for dicts, and does non-scalar things
in that case. We *want* the dictionaries to be treated as scalars, so we
hack around pandas by using UserDicts.
)annotations)UserDictabcN)TYPE_CHECKINGAny)'construct_1d_object_array_from_listlike)is_bool_dtypeis_list_likepandas_dtype)ExtensionArrayExtensionDtype)getitem_returns_viewunpack_tuple_and_ellipses)Mapping)type_tc                  X    ] tR t^7t$ ]P
                  tRt]! 4       t	R]
R&   R R ltRtR# )	JSONDtypejsonzMapping[str, Any]na_valuec                   V ^8  d   QhRR/# )   returnztype_t[JSONArray] )formats   "q/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/extension/json/array.py__annotate__JSONDtype.__annotate__<   s      &7     c                    \         # )zI
Return the array type associated with this dtype.

Returns
-------
type
)	JSONArrayselfs   &r   construct_array_typeJSONDtype.construct_array_type<   s
     r   r   N)__name__
__module____qualname____firstlineno__r   r   typenamer   r   __annotations__r"   __static_attributes__r   r   r   r   r   7   s'    ;;DD"**H, r   r   c                    a  ] tR t^Gt]! 4       tRtR!R R llt]RRRR/R l4       t	]R	 4       t
R
 tR tR R ltR R ltR tR tR"R lt]R R l4       tR tR#R ltR tR$R ltR t]R 4       tR tR tRRRR/V 3R lltR tV ;t# )%r   i  NFc                   V ^8  d   QhRR/# r   r   Noner   )r   s   "r   r   JSONArray.__annotate__K   s     - -$ -r   c                	    V FW  p\        W@P                  P                  4      '       d   K*  \        R \	        V P                  P                  4      ,           4      h	  Wn        V P
                  ;V n        V n        R# )zAll values must be of type N)
isinstancedtyper(   	TypeErrorstrdata_items_data)r!   valuesr3   copyvals   &&&& r   __init__JSONArray.__init__K   sX    Cc::??33 =DJJOO@T TUU  	 $(99,djr   r3   r:   c               	    V ! V4      # Nr   )clsscalarsr3   r:   s   &&$$r   _from_sequenceJSONArray._from_sequenceX   s    7|r   c                	^    T ! V Uu. uF  q3R8w  g   K  \        V4      NK  	  up4      # u upi )Nr   )r   )r@   r9   originalxs   &&& r   _from_factorizedJSONArray._from_factorized\   s)    ;A7KHQK;<<;s   **c                	     \        V 4      P                  WP                  R 7      #   \        \        3 d9    ^ RIHp \        P                  ! T\        R 7      pTP                  TRR7      u # i ; i)r3   )libT)convert_non_numeric)r(   rB   r3   
ValueErrorr4   pandas._libsrK   npasarrayobjectmaybe_convert_objects)r!   r9   rK   s   && r   _cast_pointwise_result JSONArray._cast_pointwise_result`   sc    	O:,,V::,FFI& 	O(ZZf5F,,V,NN	Os   $' AA0/A0c                	   \        V\        4      '       d   \        V4      p\        V\        P                  4      '       d   V P
                  V,          # \        V\        4      '       d?   V\        R 4      8X  d/   \        V 4      ! V P
                  4      pV P                  Vn        V# \        V\        4      '       dG   \        V 4      ! V P
                  V,          4      p\        W4      '       d   V P                  Vn        V# \        V4      '       g   \        R4      h\        P                  P                  P                  W4      p\!        VP"                  4      '       dP   \        V 4      P%                  \'        WRR7       UUu. uF  w  r4V'       g   K  VNK  	  uppV P"                  R7      # \        V 4      ! V Uu. uF  qPP
                  V,          NK  	  up4      # u uppi u upi )Nzuonly integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indicesTstrictrJ   )r2   tupler   numbersIntegralr6   slicer(   	_readonlyr   r	   
IndexErrorpdapiindexerscheck_array_indexerr   r3   rB   zip)r!   itemresultrF   mis   &&    r   __getitem__JSONArray.__getitem__j   ss   dE"",T2DdG,,--99T?"e$$t)<$Z		*F#~~FMe$$$Z		$0F#D//#'>> Md## L 
 66??66tBDTZZ((Dz00#&t$#?E#?411QQ#?ETZZ 1   :T:Tyy||T:;; F ;s   	G%
G%
G+c                   V ^8  d   QhRR/# r.   r   )r   s   "r   r   r0      s     % % %r   c                	   V P                   '       d   \        R 4      h\        V\        P                  4      '       d   W P
                  V&   R# \        V\        V 4      \        P                  34      '       g   \        P                  ! V.4      p\        V\        P                  4      '       du   VP                  R8X  dd   \        \        WRR7      4       FG  w  pw  rEV'       g   K  \        WPP                  P                  4      '       g   Q hWPP
                  V&   KI  	  R# \        WRR7       F:  w  rE\        WPP                  P                  4      '       g   Q hWPP
                  V&   K<  	  R# )zCannot modify read-only arrayboolFrV   N)r\   rM   r2   rY   rZ   r6   r(   r   Sequence	itertoolscyclerO   ndarrayr3   	enumeraterb   )r!   keyvaluerf   kvs   &&&   r   __setitem__JSONArray.__setitem__   s    >>><==c7++,,"IIcNed4j#,,%?@@!0#rzz**syyF/B!*3s%+H!IIAvq)!ZZ__===='(		! "J
  59DA%a9999#$IIaL :r   c                   V ^8  d   QhRR/# r   r   intr   )r   s   "r   r   r0      s       r   c                	,    \        V P                  4      # r?   )lenr6   r    s   &r   __len__JSONArray.__len__   s    499~r   c                	    \         # r?   NotImplementedr!   others   &&r   __eq__JSONArray.__eq__       r   c                	    \         # r?   r   r   s   &&r   __ne__JSONArray.__ne__   r   r   c                	   VR J d   \        R4      hVf   \        pV\        8X  d   \        \        V 4      4      # Vf#   \        P
                  ! V P                  VR7      # \        P
                  ! V P                  WR7      # )Fz:Unable to avoid copy while creating an array as requested.rJ   r3   r:   )rM   rQ   r   listrO   rP   r6   )r!   r3   r:   s   &&&r   	__array__JSONArray.__array__   sj    5=L  =EF?:4:FF<::diiu55zz$))5<<r   c                   V ^8  d   QhRR/# rx   r   )r   s   "r   r   r0      s     ( ( (r   c                	B    \         P                  ! V P                  4      # r?   )sys	getsizeofr6   r    s   &r   nbytesJSONArray.nbytes   s    }}TYY''r   c                	    \         P                  ! V P                   Uu. uF  qV P                  P                  8H  NK  	  up\
        R 7      # u upi )rJ   )rO   arrayr6   r3   r   rk   )r!   rF   s   & r   isnaJSONArray.isna   s6    xx499E9adjj1119ETRREs   !Ac                	*   \         P                  ! V4      pR pV'       df   Vf   V P                  P                  pVR8  P	                  4       '       d   \
        h V Uu. uF  qUR8w  d   V P                  V,          MTNK   	  ppM" V Uu. uF  qPP                  V,          NK  	  pp\        V 4      P                  W`P                  R7      # u upi   \         d   p\        T4      ThRp?ii ; iu upi   \         d   p\        T4      ThRp?ii ; i)zIIndex is out of bounds or cannot do a non-empty take from an empty array.NrJ   )
rO   rP   r3   r   anyrM   r6   r]   r(   rB   )r!   indexer
allow_fill
fill_valuemsglocoutputerrs   &&&&    r   takeJSONArray.take   s    **W%W 	 !!ZZ00
"!!##  /KRKRCRiDIIcNZ?7  /4;<GS))C..G< Dz((zz(BB  / o3./ = / o3./sT   C $CC C6 C1&C6 C C.C))C.1C6 6DDDc                	F    \        V 4      ! V P                  R ,          4      # ):NNN)r(   r6   r    s   &r   r:   JSONArray.copy   s    Dz$))A,''r   Tc                	   ^ RI Hp \        V4      p\        V\	        V P
                  4      4      '       d+   WP
                  8X  d   V'       d   V P                  4       # V # \        W4      '       d$   VP                  4       pVP                  WRR7      # V'       g2   \        P                  ! V  Uu. uF  p\        V4      NK  	  upVR7      # \        P                  ! V  Uu. uF  p\        V4      NK  	  upWR7      # u upi u upi )    )StringDtypeFr   rJ   )pandas.core.arrays.string_r   r
   r2   r(   r3   r:   r"   rB   rO   rP   dictr   )r!   r3   r:   r   arr_clsrF   s   &&&   r   astypeJSONArray.astype   s     	;U#eT$**-..5JJ3Fyy{"K++002G))$%)HH::51tAw5UCC88d3dT!Wd35LL 63s   1C?"Dc           	     	    \        V 4      ! V P                   Uu0 uF  p\        VP                  4       4      kK  	  up Uu. uF  p\	        V4      NK  	  up4      # u upi u upi r?   )r(   r6   rX   itemsr   )r!   drF   s   &  r   uniqueJSONArray.unique   sL     Dztyy,Qy!U1779-=y,QR,Qq47,QRSS,QRs   "AA!c                	p    \        \        P                  P                  R  V 4       4      4      pV ! V4      # )c              3  8   "   T F  qP                   x  K  	  R # 5ir?   )r6   ).0rF   s   & r   	<genexpr>.JSONArray._concat_same_type.<locals>.<genexpr>   s     1L)Q&&)s   )r   rm   chainfrom_iterable)r@   	to_concatr6   s   && r   _concat_same_typeJSONArray._concat_same_type   s+    IOO111L)1LLM4yr   c                	j    V P                  4       p\        V4      ^ 8X  d   VP                  4       pVR3# )r   r   )_values_for_argsortr{   ravel)r!   frozens   & r   _values_for_factorizeJSONArray._values_for_factorize   s1    ))+v;!\\^Frzr   c                	r    V  Uu. uF  p\        VP                  4       4      NK  	  pp\        V4      # u upi r?   )rX   r   r   )r!   rF   r   s   &  r   r   JSONArray._values_for_argsort  s1    ,01Dq%	"D16v>> 2s   "4limitc               	&   < \         SV `  WVR 7      # ))methodr   r:   )super_pad_or_backfill)r!   r   r   r:   	__class__s   &$$$r   r   JSONArray._pad_or_backfill
  s    w'v'NNr   )r8   r7   r6   )NF)NN)FN)T)r$   r%   r&   r'   r   r3   __array_priority__r<   classmethodrB   rG   rS   rg   ru   r|   r   r   r   propertyr   r   r   r:   r   r   r   r   r   r   r+   __classcell__)r   s   @r   r   r   G   s    KE- d    = =O<B%,= ( (SC:(M(T
  ?
O O4 O Or   r   c                   V ^8  d   QhRR/# )r   nry   r   )r   s   "r   r   r     s       r   c                ^   \         P                  P                  ^4      p\        V 4       Uu. uFo  p\	        \        VP                  ^ ^
4      4       Uu. uF=  pVP                  \        \        P                  4      4      VP                  ^ ^d4      3NK?  	  up4      NKq  	  up# u upi u upi )r   )
rO   randomdefault_rngranger   integerschoicer   stringascii_letters)r   rng_s   &  r   	make_datar     s    
))


"C q A 	 s||Ar233A D!5!567a9MN3	
  s   'B*AB%B*%B*)$__doc__
__future__r   collectionsr   r   rm   rY   r   r   typingr   r   numpyrO   pandas.core.dtypes.castr   pandas.core.dtypes.commonr   r	   r
   pandasr^   pandas.api.extensionsr   r   pandas.core.indexersr   r   collections.abcr   pandas._typingr   r   r   r   r   r   r   <module>r      su    #    

  K  
 '%  EO EOPr   