+
    xȇiC                        ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIHtHtHtHtHtHtHt ^ RIHt ^ RIHt ]P2                  P5                  R4      t]P8                  R 4       t]P2                  P<                  ]P2                  P?                  R. RO4      R	 4       4       t R
 R lt!]P2                  P?                  RRR.4      R 4       t"R t#]PH                  ! R4      R 4       t%R# )    )BytesION)pa_version_under17p0)	DataFrameIndex
date_rangeread_csv
read_excel	read_jsonread_parquet)_test_decoratorsz=ignore:Passing a BlockManager to DataFrame:DeprecationWarningc                    a \         P                  ! R4       \         P                  ! R4      p \        4       oR Sn         ! V3R lRV P                  4      pV P                  RVRR7       S# )	z"Emulate GCS using a binary buffer.gcsfsfsspecc                      R # )T r       h/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/io/test_gcs.py<lambda>gcs_buffer.<locals>.<lambda>$   s    tr   c                   >   <a  ] tR t^&t o ]V3R l4       tR tRtV tR# )%gcs_buffer.<locals>.MockGCSFileSystemc                 *   < SP                  ^ 4       S# )r   )seek)argskwargs
gcs_buffers   *,r   open*gcs_buffer.<locals>.MockGCSFileSystem.open'   s    OOAr   c                    R VRR/.# )nametypefiler   )selfpathr   s   &&,r   ls(gcs_buffer.<locals>.MockGCSFileSystem.ls,   s    T66233r   r   N)	__name__
__module____qualname____firstlineno__staticmethodr   r%   __static_attributes____classdictcell__)__classdict__r   s   @r   MockGCSFileSystemr   &   s!     		 
		4 	4r   r/   gsT)clobber)pytestimportorskipr   closeAbstractFileSystemregister_implementation)r   r/   r   s     @r   r   r      sb        *FJ#J4F55 4 ""4):D"Ir   formatc                  a \        R^^.RR\        P                  .RRR.R\        R^R	R
7      /4      pRV 2pVR8X  d%   VP	                  VRR7       \        VR.^ R7      pEMVR8X  d%   RpVP                  V4       \        VR.^ R7      pEMWVR8X  d$   VP                  VRR7       \        VR.R7      pEM-VR8X  d   \        P                  ! R4       \        P                  ! R4      o ! V3R lRSP                  4      pVP                  \        P                  P                  \         '       * \"        RR7      4       VP%                  4       ;_uu_ 4       p	V	P'                  SRV4       VP)                  V4       \+        V4      pRRR4       VP-                  4       p
V
P.                  R8X  g   Q hM0VR 8X  d*   \        P                  ! R!4       VP1                  V4       TpVR",          pVR$9   d&   VR,          P2                  P5                  R#4      VR&   \6        P8                  ! XV4       R#   + '       g   i     L; i)%z9
Test that many to/read functions support GCS.

GH 33987
intfloat       @strtsdt
2018-06-18ns)periodsunitzgs://test/test.csvT)index)parse_dates	index_colexcelzgs://test/test.xlsxjsoniso)date_format)convert_datesparquetpyarrowz
pyarrow.fsc                   8   <a  ] tR t^Yt o ]V3R l4       tRtV tR# )(test_to_read_gcs.<locals>.MockFileSystemc                   < \        R 4       \        P                  ! V P                  RR4      4      P	                  4       P                  4       pSP                  V4      # )zUsing pyarrow filesystemzgs:// )printpathlibPathreplaceabsoluteas_uriLocalFileSystem)r$   to_localpa_fss   & r   from_uri1test_to_read_gcs.<locals>.MockFileSystem.from_uriZ   sH    01"<<Wb(ABKKMTTV,,X66r   r   N)r'   r(   r)   r*   r+   r\   r,   r-   )r.   r[   s   @r   MockFileSystemrP   Y   s     7 7r   r^   z&pyarrow 17 broke the mocked filesystem)raisesreason
FileSystemNz2Using pyarrow filesystem
Using pyarrow filesystem
markdowntabulate:NNNus)rD   rH   rI   )r   npnanr   to_csvr   to_excelr	   to_jsonr
   r2   r3   ra   applymarkermarkxfailr   	TypeErrorcontextsetattr
to_parquetr   
readouterroutto_markdownr?   as_unittmassert_frame_equal)r   r7   monkeypatchcapsysrequestdf1r$   df2r^   mcapturedexpectedr[   s   &&&&&       @r   test_to_read_gcsr   7   s    Aq6c266]C:*\14@		
C VH%D

4t
$t$1=	7	$TD6Q?	6	De,TF3	9	I&##L1	7U-- 	7 	KK(( ?  	
   ""aIIe\>:NN4 t$C # $$&||UUUU	:	J'1vH))!$**2248#x( #"s   0H55I	c                <    V ^8  d   QhR\         R\         R\        /# )   resultr~   compression)bytesr<   )r7   s   "r   __annotate__r   y   s!     " "% "5 "s "r   c           	        VR8X  d   \         P                  ! \        V 4      4      ;_uu_ 4       p\         P                  ! \        V4      4      ;_uu_ 4       p\        VP	                  4       VP	                  4       4       F"  w  rVVP
                  VP
                  8X  d   K"  Q h	  RRR4       RRR4       R# VR8X  d   \        P                  ! \        V 4      R7      ;_uu_ 4       p\        P                  ! \        V4      R7      ;_uu_ 4       p\        VP                  4       VP                  4       4       Fe  w  rVP                  V	4      pVP                  V
4      pVRJ VRJ 8X  g   Q hVf   K:  Vf   K@  VP                  4       VP                  4       8X  d   Ke  Q h	  RRR4       RRR4       R# W8X  g   Q hR#   + '       g   i     EL!; i  + '       g   i     R# ; i  + '       g   i     LL; i  + '       g   i     R# ; i)z
For zip compression, only compare the CRC-32 checksum of the file contents
to avoid checking the time-dependent last-modified timestamp which
in some CI builds is off-by-one

See https://en.wikipedia.org/wiki/ZIP_(file_format)#File_headers
zipNtar)fileobj)zipfileZipFiler   r   infolistCRCtarfiler   
getmembersextractfileread)r   r~   r   expresres_infoexp_infotar_exptar_restar_res_infotar_exp_infoactual_fileexpected_files   &&&          r   assert_equal_zip_safer   y   s    e OOGFO,,OOGH-..#&)#,,.#,,.&I"||x||333 'J / -,
 
	LL11WLL!233w.1""$g&8&8&:/* &11,? ' 3 3L A#t+$1FGGG*}/H&++-1C1C1EEEE/ 4 21 !!!% /.. -,, 43 211sa   (GAF>	"F>	&G')G9AG&	3G&	9 G&	G&	"G9>G		GG#	&G61G99H
	encodingutf-8cp1251c                   \        R\        P                  ! ^x4      P                  R4      ,          \	        \        R4      4      \	        \        ^4       Uu. uF  pRV 2NK
  	  up4      R7      pRV/pVR8X  d   ^VR&   \        4       pVP                  WvVRR	7       R
pVP                  WVR7       V P                  4       p	VP                  4       p
\        WV4       \        V^ WR7      p\        P                  ! W[4       W1,          pRVR&   VRV 2,          pVP                  WVR7       V P                  4       p	VP                  4       p
\        WV4       \        V^ RVR7      p\        P                  ! W[4       R# u upi )z
Compression and encoding should with GCS.

GH 35677 (to_csv, compression), GH 26124 (to_csv, encoding), and
GH 32392 (read_csv, encoding)
g?ABCDzi-)columnsrE   methodgzipmtimewb)r   r   modegs://test/test.csv)r   r   )rG   r   r   infer.N)      )r   re   arangereshaper   listranger   rg   getvaluer   r   ru   rv   )r   compression_onlyr   compression_to_extensionidfr   bufferpath_gcsr   r~   read_dffile_exts   &&&&         r   $test_to_csv_compression_encoding_gcsr      si    
biin$$W--d6l#uRy1y!r!Xy12
B -.K6! GYFIIftIL $HIIh(IC



C H#)9:A+;G "& (9H#K!H:HIIh(IC



C H#)9:x1'HUG"&C 2s   Fc                2  a \         P                  ! R4       \         P                  ! R4       ^ RIHp \	        R^^.RR\
        P                  .R\        R^R	7      /4      p ! V3R
 lRV4      pV P                  RV4       VP                  RRRRR7       R# )zCRegression test for writing to a not-yet-existent GCS Parquet file.fastparquetr   )r5   r9   r:   r;   r?   r@   )rB   c                   2   <a  ] tR t^t o RV3R lltRtV tR# )7test_to_parquet_gcs_new_file.<locals>.MockGCSFileSystemc                v   < R V9  d   \         h\        \        P                  P	                  SR4      VRR7      # )wztest.parquetr   )r   )FileNotFoundErrorr   osr$   join)r#   r$   r   r   tmpdirs   &&&*r   r   <test_to_parquet_gcs_new_file.<locals>.MockGCSFileSystem.open   s.    $''V^<dWUUr   r   N)r)r'   r(   r)   r*   r   r,   r-   )r.   r   s   @r   r/   r      s     	V 	Vr   r/   zgcsfs.GCSFileSystemr   TN)rE   enginer   )
r2   r3   r   r5   r   re   rf   r   ro   rp   )rw   r   r5   rz   r/   s   &f   r   test_to_parquet_gcs_new_filer      s    
&
 )
Aq6c266]*\15	
CV. V -/@ANNDD  r   r   c                      \         P                  ! \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)r   N)ru   external_error_raisedImportErrorr   r   r   r   test_gcs_not_present_exceptionr      s+    		!	!+	.	.%& 
/	.	.	.s	   9A
	)rD   rI   rM   rH   rb   )&ior   r   rT   r   r   numpyre   r2   pandas.compat.pyarrowr   pandasr   r   r   r   r	   r
   r   pandas._testing_testingru   pandas.utilr   tdrk   filterwarnings
pytestmarkfixturer   
single_cpuparametrizer   r   r   r   skip_if_installedr   r   r   r   <module>r      s     	      6    .[[''C

  2 #RS=) T =)@"B gx%89-' :-'`6 g' 'r   