+
    NV-jC  ã                   óè  € ^ 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   ó    Úi/Volumes/fast/ai/experiments/ui-tars-smoke/.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   ø€ à�O‰O˜AÔØÐr   c                ó   € R VRR/.# )ÚnameÚtypeÚfiler   )ÚselfÚpathr   s   &&,r   ÚlsÚ(gcs_buffer.<locals>.MockGCSFileSystem.ls,   s   € à˜T 6¨6Ð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Ô÷4˜F×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M‚V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_uriÚ1test_to_read_gcs.<locals>.MockFileSystem.from_uriZ   sH   ø€ äÐ0Ô1Ü"Ÿ<š<¨¯©°W¸bÓ(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  ø€ ô à�A�q�6Ø�cœ2Ÿ6™6�]Ø�C˜�:Ø”*˜\°1¸4Ô@ð		
ó€Cð ˜V˜HÐ%€Dà�„Ø�
‰
�4˜tˆ
Ô$Ü�t¨$¨¸1Ô=ŠØ	�7Ô	Ø$ˆØ�‰�TÔÜ˜¨D¨6¸QÔ?ŠØ	�6Ô	Ø�‰�D eˆÔ,Ü˜¨T¨FÔ3ŠØ	�9Ô	Ü×Ò˜IÔ&Ü×#Ò# LÓ1ˆ÷	7˜U×-Ñ-ô 	7ð 	×ÑÜ�K‰K×ÑÜ(Ô(Ü Ø?ð ó ô	
ð × Ñ ×"Ô" aØ�I‰I�e˜\¨>Ô:Ø�N‰N˜4Ô Ü˜tÓ$ˆC÷ #ð ×$Ñ$Ó&ˆØ�|‰|ÐUÔUÐUÑUØ	�:Ô	Ü×Ò˜JÔ'Ø�‰˜ÔØˆà�1�v€HØÐ)Ô)Ø! $�×*Ñ*×2Ñ2°4Ó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  ršV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Ôô �OŠOœG F›O×,Ô,°Ü�OŠOœG HÓ-×.Ô.°#ä&)¨#¯,©,«.¸#¿,¹,».Ö&IÑ"�Ø—|‘| x§|¡|Ö3Ð3Ð3ñ 'J÷ /÷ -Ñ,ð
 
˜Ô	ä�LŠL¤¨£×1Õ1°WÜ�LŠL¤¨Ó!2×3Õ3°wä.1Ø×"Ñ"Ó$ g×&8Ñ&8Ó&:ö/Ñ*�ð &×1Ñ1°,Ó?�Ø '× 3Ñ 3°LÓ A�Ø# tÐ+°À$Ð1FÔGÐGÐGØÔ*¨}Ô/HØ&×+Ñ+Ó-°×1CÑ1CÓ1EÖEÐEÐEñ/÷ 4÷ 2Ñ1ð Ô!Ð!Ò!÷% /×.Ð.ú÷ -×,Ð,ú÷ 4×3ú÷ 2×1Ð1úsa   ¯(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                  W†VR7       V P                  4       p	VP                  4       p
\        WšV4       \        V^ WR7      p\        P                  ! W[4       W1,          pRVR&   VRV 2,          pVP                  W†VR7       V P                  4       p	VP                  4       p
\        WšV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  € ô 
ØŒb�iŠi˜‹n×$Ñ$ WÓ-Õ-Ü”d˜6“lÓ#Ü¤u¨R¤yÓ1¡y !�r˜!˜“X¡yÑ1Ó2ô
€Bð Ð-Ð.€KØ˜6Ô!Ø ˆ�GÑÜ‹Y€FØ‡I�Iˆf¸Àt€IÔLð $€HØ‡I�Iˆh¸(€IÔCØ
×
Ñ
Ó
€CØ�‰Ó €HÜ˜#Ð)9Ô:äØ˜AÐ+;ô€Gô ×Ò˜"Ô&ð (Õ9€HØ#€K�ÑØ�!�H�:�Õ€HØ‡I�Iˆh¸(€IÔCà
×
Ñ
Ó
€CØ�‰Ó €HÜ˜#Ð)9Ô:ä�x¨1¸'ÈHÔU€GÜ×Ò˜"Ö&ùò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¨^Ó<¸dÈWÔ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�   ø€ ä
×Ò˜Ô&Ü
×Ò˜Ô å)ä
à�A�q�6Ø�cœ2Ÿ6™6�]Ø”*˜\°1Ô5ð	
ó€C÷VÐ.ô Vð ×ÑÐ-Ð/@ÔAØ‡N�NØ 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 ‡�×Ñ˜ g¨xÐ%8Ó9ñ-'ó :ð-'ò`ð6 ×Ò�gÓñ'ó ò'r   