+
    xȇiH                        ^ RI Ht ^ RIHtHt ^ RIHt ^ RIt^ RI	t	^ RI
t^ RI
HtHt ^ RIHt ^ RIHt ]	P&                  P)                  R4      t]	P,                  R 4       t]	P,                  ! R	R
.R7      R 4       tR tR tR tR tR tR t]	P&                  P?                  R^R.4      ]	P&                  P?                  R]].4      R 4       4       t R t!R t"R t#R t$]	P&                  P?                  RR^.4      R 4       t%]	P&                  P?                  R. R1O4      R 4       t&]	P&                  P?                  R. R2O4      R 4       t'R t(]	P&                  P?                  R^^.4      R  4       t)]	P&                  P?                  R!R3R4.4      R" 4       t*R# t+R$ t,R% t-]	P&                  P?                  R&. R5O4      R' 4       t.R( t/]	P&                  P?                  R)R*R+.4      R, 4       t0R- t1R. t2R/ t3R0 t4R# )6    Iterator)BytesIOStringIO)PathN)	DataFrame	read_json)
JsonReaderz=ignore:Passing a BlockManager to DataFrame:DeprecationWarningc                  N    \        R . ROR. RO/4      p V P                  RRR7      # )ABTrecordslinesorient                  )r   to_json)dfs    s/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/io/json/test_readlines.pylines_json_dfr      s(    	CC3	4B::D:33    ujsonpyarrow)paramsc                 h    V P                   R 8X  d   \        P                  ! R4       V P                   # )r    zpyarrow.json)parampytestimportorskip)requests   &r   enginer'      s&    }}	!N+==r   c                      \        \        R 4      RR7      p \        ^^.^^..RR.R7      p\        P                  ! W4       R# )z!{"a": 1, "b": 2}
{"b":2, "a" :1}
Tr   abcolumnsN)r	   r   r   tmassert_frame_equal)resultexpecteds     r   test_read_jsonlr2   &   s?    x EFdSF1a&1a&)C:>H&+r   c                     \        V ! R RRR4      RVR7      p\        R. R	OR. R
O/4      p\        P                  ! W#4       R# )iojsondataline_delimited.jsonTr   r'   r*   r+   N)r   r   r   )r   r   r   )r	   r   r.   r/   )datapathr'   r0   r1   s   &&  r   test_read_jsonl_engine_pyarrowr:   -   sD    vv'<=F
 #y#y9:H&+r   c                    VR 8X  d7   RpV P                  \        P                  P                  V\        R7      4       \        ^^.RR.R3.. ROR7      pVP                  RRR	7      pVR 8X  d   \        \        V4      VR
7      pM\        \        V4      VR
7      p\        . RO. RO.. ROR7      p\        P                  ! WV4       R# )r    zEPyarrow only supports a file path as an input and line delimited jsonreasonraises
2020-03-052020-04-08T09:58:49+00:00hectorr,   Tr   r   r'   N)accountsdatename)r   r?   rA   )r   r@   rA   )applymarkerr$   markxfail
ValueErrorr   r   r	   r   r.   r/   )r&   r'   r=   r   	json_liner0   r1   s   &&     r   test_read_datetimerK   7   s    XFKK--VJ-OP	a&<!<=x	HI,
B 

i
8I8I.v>8I.v>	$&PQ,H &+r   c                     R p \        V 4      p \        V RR7      p\        RR.RR..RR.R7      p\        P                  ! W4       R p \        \        V 4      RR7      p\        RR.RR..RR.R7      p\        P                  ! W4       R	# )
u5   {"a": "foo”", "b": "bar"}
{"a": "foo", "b": "bar"}
Tr)   u   foo”barfoor*   r+   r,   N)r   r	   r   r.   r/   )r5   r0   r1   s      r   test_read_jsonl_unicode_charsrO   O   s    
 EDD>Dt4(F;.?#sTH&+ EDx~T2F;.?#sTH&+r   c                     \        ^^.^^..RR.R7      p V P                  RRR7      pRpW8X  g   Q h\        RR	.R
R	..RR.R7      p V P                  RRR7      pRpW8X  g   Q h\        P                  ! \	        \        V4      RR7      V 4       \        RR	.R
R	..RR.R7      p V P                  RRR7      pRpW8X  g   Q h\        P                  ! \	        \        V4      RR7      V 4       R# )r   r*   r+   r,   r   Tr   r   z{"a":1,"b":2}
{"a":1,"b":2}
zfoo}rM   zfoo"z/{"a":"foo}","b":"bar"}
{"a":"foo\"","b":"bar"}
r)   zfoo\za\z4{"a\\":"foo\\","b":"bar"}
{"a\\":"foo\"","b":"bar"}
N)r   r   r.   r/   r	   r   )r   r0   r1   s      r   test_to_jsonlrR   a   s    	QFQF#c3Z	8BZZyZ5F/H	VUOfe_5Sz	JBZZyZ5FCH)HV$4DA2F 
We$vuo6	MBZZyZ5FNH)HV$4DA2Fr   c                      \        ^^.^^..RR.R7      p V P                  RRR7      P                  R4      p^pW8X  g   Q hR# )	r   r*   r+   r,   r   TrQ   
N)r   r   count)r   actual_new_lines_countexpected_new_lines_counts      r   test_to_jsonl_count_new_linesrX   v   sO    	QFQF#c3Z	8BZZyZEKKDQ !===r   	chunksizeg      ?bufferc           	         V\         8X  d   VP                  4       pVR 8X  d7   RpV P                  \        P                  P                  V\        R7      4       \        V! V4      RR7      pV! V4      ;_uu_ 4       p\        VRW$R7      ;_uu_ 4       p\        P                  ! V4      p	RRR4       RRR4       \        P                  ! X	V4       R#   + '       g   i     L1; i  + '       g   i     L<; i)r    mPyarrow only supports a file path as an input and line delimited jsonand doesn't support chunksize parameter.r<   Tr)   r   rY   r'   N)r   encoderF   r$   rG   rH   rI   r	   pdconcatr.   r/   )
r&   r   rY   rZ   r'   r=   	unchunkedbufreaderchunkeds
   &&&&&     r   test_readjson_chunksre   ~   s     %,,.7 	 	FKK--VJ-OP&/t<I}#TYFF&))F# 	G 	
 '9-	 	GF 	s$   <C&C	*C&C#C&&C6	c           	         R p\         P                  ! \        VR7      ;_uu_ 4        \        \	        V 4      R^VR7      ;_uu_ 4       p RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)z*chunksize can only be passed if lines=TruematchFr]   Nr$   r>   rI   r	   r   )r   r'   msg_s   &&  r   &test_readjson_chunksize_requires_linesrl      s]    
6C	z	-	-]#5Af
 

 
.	-
 
 
.	-	-s#   !A/A	
A/A,'A//B 	c                    VR 8X  d2   RpV P                  \        P                  P                  VR7      4       \        P
                  ! R^R^/4      p\        VP                  RRR7      4      p\        VRRVR	7      p\        VP                  RRR7      4      p\        VRR^VR
7      ;_uu_ 4       p\        P                  ! V4      pRRR4       \        P                  ! XV4       R#   + '       g   i     L); i)r    r\   )r=   r   r   Tr   r   series)r   typr'   )r   ro   rY   r'   N)rF   r$   rG   rH   r_   Seriesr   r   r	   r`   r.   assert_series_equal)r&   r'   r=   sstriora   rc   rd   s   &&      r   test_readjson_chunks_seriesrt      s    7 	 	FKK--V-<= 			33"#AQYYT)Y<=E%t&IIQYYT)Y<=E	Tx1V
 
	))F#

 7I.
 
s   2C**C:	c                 v   VR 8X  d7   RpV P                  \        P                  P                  V\        R7      4       \        \        V4      R^VR7      ;_uu_ 4       p\        V4      pRRR4       X^ ,          P                  R8X  g   Q hV^,          P                  R8X  g   Q hR#   + '       g   i     LF; i)r    r\   r<   Tr]   Nr   r   )r   r   )	rF   r$   rG   rH   rI   r	   r   listshape)r&   r   r'   r=   rc   chunkss   &&&   r   test_readjson_each_chunkrz      s    7 	 	FKK--VJ-OP 
tq
 
	f
 !9??f$$$!9??f$$$
 
s   B((B8	c                    VR 8X  d7   RpV P                  \        P                  P                  V\        R7      4       \        R. ROR. RO/4      pVP                  VRRR7       \        VR^VR7      ;_uu_ 4       p\        P                  ! V4      pR	R	R	4       \        VRVR
7      p\        P                  ! VX4       R	#   + '       g   i     L7; i)r    r\   r<   r   r   Tr   r   r]   Nr8   r   r   )rF   r$   rG   rH   rI   r   r   r	   r_   r`   r.   r/   )r&   r'   	temp_filer=   r   rc   rd   ra   s   &&&     r   test_readjson_chunks_from_filer}      s    7 	 	FKK--VJ-OP	CC3	4BJJyYJ7	9DAf	E	E))F# 
F)4?I)W- 
F	Es   <CC	c                 R   \        R . R
OR. RO/4      pVP                  VRRR7       \        VRRRRRRRRRRV RRR7      pV;_uu_ 4        VP                  4        RRR4       VP                  P
                  P                  '       g   Q R	V  24       hR#   + '       g   i     LB; i)r   r   Tr   r   NframeF)r   ro   dtypeconvert_axesconvert_dateskeep_default_datesprecise_float	date_unitencodingr   rY   compressionnrowsz%didn't close stream with chunksize = r   r   )r   r   r
   readhandleshandleclosed)rY   r|   r   rc   s   &&  r   test_readjson_chunks_closesr      s    	CC3	4BJJyYJ7F  
 
>>  ''' 
/	{;' 
s   BB&	c           	         R p\         P                  ! \        VR7      ;_uu_ 4        \        \	        V 4      RWR7      ;_uu_ 4       p RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)z"'chunksize' must be an integer >=1rg   Tr]   Nri   )r   rY   r'   rj   rk   s   &&&  r   test_readjson_invalid_chunksizer      s[    
/C	z	-	-]#49
 

 
.	-
 
 
.	-	-s#    A.A		A.A+&A..A?	c                    R p\        R. ROR. R	O/4      p\        \        V4      RV R7      pV e*   T;_uu_ 4        \        P                  ! V4      pRRR4       \
        P                  ! W#RV  2R7       R#   + '       g   i     L-; i)
zF

    {"A":1,"B":4}



    {"A":2,"B":5}







    {"A":3,"B":6}
    r   r   Tr   rY   Nzchunksize: )objr   r   )r   r	   r   r_   r`   r.   r/   )rY   jorigtests   &   r   )test_readjson_chunks_multiple_empty_linesr     sl    	A  c9c956DXa[	BDT99T?D $K	{*CD Ts   A77B	c                    VR 8X  d7   RpV P                  \        P                  P                  V\        R7      4       VP                  RR 4       \        VRRR7      ;_uu_ 4       pVP                  R4       R	R	R	4       \        W2R
7      p\        RR./4      p\        P                  ! Wg4       R	#   + '       g   i     LB; i)r    r\   r<   zlocale.getpreferredencodingc                     R # )cp949 )do_setlocales   &r   <lambda>'test_readjson_unicode.<locals>.<lambda>)  s    Gr   wzutf-8)r   u6   {"£©µÀÆÖÞßéöÿ":["АБВГДабвгд가"]}NrB   u   £©µÀÆÖÞßéöÿu   АБВГДабвгд가)rF   r$   rG   rH   rI   setattropenwriter	   r   r.   r/   )r&   monkeypatchr'   r|   r=   fr0   r1   s   &&&&    r   test_readjson_unicoder      s    7 	 	FKK--VJ-OP57ST	iw	/	/1	HI 
0 y0F25N4OPQH&+ 
0	/s   'B33C	r   c                     R p\        \        V4      RV R7      p\        R. ROR. RO/4      P                  RV  p\        P
                  ! W44       R# )[{"a": 1, "b": 2}
        {"a": 3, "b": 4}
        {"a": 5, "b": 6}
        {"a": 7, "b": 8}T)r   r   r*   r+   Nr   r   r      r   r   r      )r	   r   r   ilocr.   r/   )r   r'   jsonlr0   r1   s   &&   r   test_readjson_nrowsr   2  sK    E xd%@F#|S,?@EEfuMH&+r   znrows,chunksizec                 8   VR 8X  d7   RpV P                  \        P                  P                  V\        R7      4       RpVR 8w  dA   \        \        V4      RWVR7      ;_uu_ 4       p\        P                  ! V4      pRRR4       M6\        VRWVR7      ;_uu_ 4       p\        P                  ! V4      pRRR4       \        R. R	OR. R
O/4      P                  RV p\        P                  ! XV4       R#   + '       g   i     LI; i  + '       g   i     L\; i)r    r\   r<   r   T)r   r   rY   r'   Nr*   r+   r   r   )rF   r$   rG   rH   rI   r	   r   r_   r`   r   r   r.   r/   )	r&   r   rY   r'   r=   r   rc   rd   r1   s	   &&&&     r   test_readjson_nrows_chunksr   ?  s     7 	 	FKK--VJ-OPE
 UO4uRX
 
ii'G
 

 U
 
ii'G
 #|S,?@EEfuMH'8,
 


 
s   'C6D	6D		D	c           	          R pRp\         P                  ! \        VR7      ;_uu_ 4        \        VR^V R7       RRR4       R#   + '       g   i     R# ; i)r   z&nrows can only be passed if lines=Truerg   F)r   r   r'   N)r$   r>   rI   r	   )r'   r   rj   s   &  r   "test_readjson_nrows_requires_linesr   ^  s>    E 3C	z	-	-%uAf= 
.	-	-	-s   AA	c                    VR 8X  d7   RpV P                  \        P                  P                  V\        R7      4       \        ^^..RR.^ .R7      \        ^^..RR.^.R7      \        ^^..RR.^.R7      .pV! RRRR	4      p\        V4      P                  4       p\        VR
^VR7      ;_uu_ 4       p\        V4       F"  w  r\        P                  ! WV,          4       K$  	  RRR4       R#   + '       g   i     R# ; i)r    r\   r<   r*   r+   )r-   indexr4   r5   r6   r7   Tr]   N)rF   r$   rG   rH   rI   r   r   as_urir	   	enumerater.   r/   )
r&   r9   r'   r=   df_list_expectedos_pathfile_url
url_readerr   chucks
   &&&       r   "test_readjson_lines_chunks_fileurlr   j  s     7 	 	FKK--VJ-OP 	Aq6(S#Jqc:Aq6(S#Jqc:Aq6(S#Jqc:
 tVV-BCGG}##%H	841V	D	D
%j1LE!!%%)@A 2 
E	D	D	Ds   42C00D	c            
          R R,          p  ! R R4      pV! V 4      p\        \        \        VR^dR7      4      4      ^8  g   Q hVP                  ^
8  g   Q hR# )z\{"a": 1, "b": 2}
        {"a": 3, "b": 4}
        {"a": 5, "b": 6}
        {"a": 7, "b": 8}
i  c                   J   a  ] tR tRt o V 3R lR ltR tV 3R lR ltRtV tR# )	/test_chunksize_is_incremental.<locals>.MyReaderi  c                   < V ^8  d   QhRR/# )r   returnNr   )format__classdict__s   "r   __annotate__<test_chunksize_is_incremental.<locals>.MyReader.__annotate__  s     	/ 	/ 	/r   c                4    ^ V n         \        V4      V n        R# )r   N)
read_countr   stringio)selfcontentss   &&r   __init__8test_chunksize_is_incremental.<locals>.MyReader.__init__  s    DO$X.DMr   c                h    V ;P                   ^,          un         V P                  P                  ! V!  # r   )r   r   r   )r   argss   &*r   r   4test_chunksize_is_incremental.<locals>.MyReader.read  s%    OOq O==%%t,,r   c                    < V ^8  d   QhRS[ /# )r   r   r   )r   r   s   "r   r   r     s     	' 	'h 	'r   c                ^    V ;P                   ^,          un         \        V P                  4      # r   )r   iterr   )r   s   &r   __iter__8test_chunksize_is_incremental.<locals>.MyReader.__iter__  s    OOq O&&r   )r   r   N)	__name__
__module____qualname____firstlineno__r   r   r   __static_attributes____classdictcell__)r   s   @r   MyReaderr     s     	/ 	/	-	' 	'r   r   Tr   N)lenrw   r	   r   )r   r   rc   s      r   test_chunksize_is_incrementalr     s`    	 		 
' ' e_FtIfDC@ABQFFFr!!!r   orient_c                     \        R ^^.RRR./4      pRp\        P                  ! \        VR7      ;_uu_ 4        VP	                  RV R7       RRR4       R#   + '       g   i     R# ; i)col1col2r*   r+   Pmode='a' \(append\) is only supported when lines is True and orient is 'records'rg   )moder   Nr   r$   r>   rI   r   )r   r   rj   s   &  r   test_to_json_append_orientr     s[     
FQFFS#J7	8B	0  
z	-	-


G
, 
.	-	-	-s   AA)	c                      \        R ^^.RRR./4      p Rp\        P                  ! \        VR7      ;_uu_ 4        V P	                  RRRR7       R	R	R	4       R	#   + '       g   i     R	# ; i)
r   r   r*   r+   r   rg   Fr   r   r   r   Nr   )r   rj   s     r   test_to_json_append_linesr     s]     
FQFFS#J7	8B	0  
z	-	-


5
; 
.	-	-	-s   AA*	mode_rxc                     \        R ^^.RRR./4      pRV  R2p\        P                  ! \        VR7      ;_uu_ 4        VP	                  V RRR	7       R
R
R
4       R
#   + '       g   i     R
# ; i)r   r   r*   r+   zmode=z@ is not a valid option.Only 'w' and 'a' are currently supported.rg   Fr   r   Nr   )r   r   rj   s   &  r   test_to_json_append_moder     se     
FQFFS#J7	8B
wVW  
z	-	-


U9
= 
.	-	-	-s   AA.	c                    \        R ^^.RRR./4      p\        R ^^.RRR./4      p\        R . ROR. RO/4      pVP                  V RRR7       VP                  V RRRR	7       \        V RR
7      p\        P                  ! WC4       R# )r   r   r*   r+   cdTr   r   r   r)   N)r   r   r   r   )r*   r+   r   r   )r   r   r	   r.   r/   )r|   df1df2r1   r0   s   &    r   -test_to_json_append_output_consistent_columnsr     s     VaVVc3Z8
9C
VaVVc3Z8
9C&,8LMNHKK	iK8KK	4	KB y-F&+r   c                 V   \        R ^^.RRR./4      p\        RRR.RRR./4      p\        R . ROR. ROR\        P                  \        P                  RR./4      pVP                  V RR
RR7       VP                  V RR
RR7       \	        V R
R7      p\
        P                  ! WC4       R	# )r   r   r*   r+   er   col3!#NTr   r   r)   )r   r   NN)r*   r+   r   r   )r   npnanr   r	   r.   r/   )r|   r   df3r1   r0   s   &    r   /test_to_json_append_output_inconsistent_columnsr     s     VaVVc3Z8
9C
Vc3Z#s<
=C&(RVVRVVS#.	
H KK	4	KBKK	4	KB y-F&+r   c                    \        R ^^.RRR./4      p\        R ^^.RRR./4      p\        RRR.RR	R
./4      p\        RRR./4      p\        R . RORRRRRRR\        P                  \        P                  .R\        P                  \        P                  \        P                  \        P                  R	R
\        P                  \        P                  .R. RO/4      P                  RR/4      pVP	                  V RRRR7       VP	                  V RRRR7       VP	                  V RRRR7       VP	                  V RRRR7       \        V RR7      p\        P                  ! We4       R# )r   r   r*   r+   r   r   r   r   r   r   r   col4TFNfloatr   r   r)   )r   r   r   r   NNNN)NNNNNNTFr   r   r   astyper   r	   r.   r/   r|   r   r   r   df4r1   r0   s   &      r   ,test_to_json_append_output_different_columnsr    sQ    VaVVc3Z8
9C
VaVVc3Z8
9C
Vc3Z#s<
=C
VdE]+
,C8S#sCc266266BRVVRVVRVVRVVS#rvvrvvNE		
 ffg  KK	4	KBKK	4	KBKK	4	KBKK	4	KB y-F&+r   c                    \        R ^^.RRR./4      p\        R ^^.RRR./4      p\        RRR.RR	R
./4      p\        RRR./4      p\        R. ROR\        P                  \        P                  RRRRRR.R\        P                  \        P                  R	R
\        P                  \        P                  \        P                  \        P                  .R . RO/4      P                  RR/4      pVP	                  V RRRR7       VP	                  V RRRR7       VP	                  V RRRR7       VP	                  V RRRR7       \        V RR7      p\        P                  ! We4       R# )r   r   r*   r+   r   r   r   r   r   r   r   r   TFNr   r   r   r)   )TFNNNNNN)NNNNr   r   r   r   r   r  s   &      r   6test_to_json_append_output_different_columns_reorderedr    sS    VaVVc3Z8
9C
VaVVc3Z8
9C
Vc3Z#s<
=C
VdE]+
,C ERVVRVVS#sCcBRVVRVVS#rvvrvvrvvrvvN8		
 ffg  KK	4	KBKK	4	KBKK	4	KBKK	4	KB y-F&+r   )r   g@rN   )Nr   r   rv   )r   r   )splitr   table)5collections.abcr   r4   r   r   pathlibr   numpyr   r$   pandasr_   r   r	   pandas._testing_testingr.   pandas.io.json._jsonr
   rG   filterwarnings
pytestmarkfixturer   r'   r2   r:   rK   rO   rR   rX   parametrizere   rl   rt   rz   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r   r   r   <module>r     s;   $      +[[''C

 4 4
 +, -,,,0,$G*> q#h/GX#67. 8 0.6/0%&." tQi0 14 &9: ; l3E 4E2,$ 1a&)	, *	, *VV,<=- >-<	>B."8 $?@	- A	-	< 3*-> .>,",.,8,r   