HOME


sh-3ll 1.0
DIR:/usr/local/lib64/python3.6/site-packages/pandas/tests/io/__pycache__/
Upload File :
Current File : //usr/local/lib64/python3.6/site-packages/pandas/tests/io/__pycache__/test_fsspec.cpython-36.pyc
3

���h]�@sddlZddlZddlmZmZmZmZddlj	Z
ddlmZ
eddgdejgddged	d
d�d��Zejd
d�j�Zejdd��Zdd�Zdd�Zdd�Ze
jd�dd��Ze
jd�dd��Zejjdddd g�e
jd�d!d"���Ze
jd�e
jd�d#d$���Ze
jd%�d&d'��Z dS)(�N)�	DataFrame�
date_range�read_csv�read_parquet)�_test_decorators��g@�t�sz
2018-06-18�)Zperiods)�int�float�str�dtF)�indexccs(tjd�}|jd�}|V|jj�dS)N�fsspecZmemory)�pytestZimportorskip�
filesystem�store�clear)rZmemfs�r�=/tmp/pip-build-5_djhm0z/pandas/pandas/tests/io/test_fsspec.py�
cleared_fss

rcCs:ddlm}|td�|jd<tddgd�}tjt|�dS)Nr)�
MemoryFile)�dataz
test/test.csvzmemory://test/test.csvr)�parse_dates)Zfsspec.implementations.memoryr�textrr�tm�assert_frame_equal�df1)rr�df2rrr�
test_read_csvsr!cCs�ddlm}ddlm}|jj�tjt�� }t	d�dt
|j�ksHt�WdQRXd}|j
|dd|d	��tjt�� }t	d
�|t
|j�ks�t�WdQRXdS)Nr)�registry)�known_implementationsznosuchprotocol://test/test.csvZnosuchprotocolztest error messgaeZ
couldexistzunimportable.CouldExist)�class�errzcouldexist://test/test.csv)rr"Zfsspec.registryr#�targetrr�raises�
ValueErrorrr�value�AssertionError�setitem�ImportError)�monkeypatchrr"r#�eZerr_mgsrrr�test_reasonable_error's
r/cCs.tjddd�tddgdd�}tjt|�dS)Nzmemory://test/test.csvT)rrr)rZ	index_col)r�to_csvrrr)rr rrr�test_to_csv:sr1�fastparquetcCstjddddd�dS)zCRegression test for writing to a not-yet-existent GCS Parquet file.zmemory://test/test.csvTr2N)r�engine�compression)r�
to_parquet)r-rrrr�test_to_parquet_new_fileAsr6Zs3fscCs@tjtd�t|��tjtd�t|��tjtd�t|��dS)Nzs3://pandas-test/tips.csvzs3://pandas-test/tips.csv.gzzs3://pandas-test/tips.csv.bz2)r�assert_equalr)�s3_resource�	tips_filerrr�test_from_s3_csvIsr:�protocolZs3Zs3aZs3ncCstjtd|�t|��dS)Nz%s://pandas-test/tips.csv)rr7r)r8r9r;rrr�test_s3_protocolsQsr<cCs2d}tj|dddd�t|dd�}tjt|�dS)Nzs3://pandas-test/test.parquetFr2)rr3r4)r3)rr5rrr7)r8�fnr rrr�test_s3_parquetYsr>rc
Cs4tjt�� }td�dt|j�ks&t�WdQRXdS)Nzmemory://test/test.csvzfsspec library is required)rr'r,rrr)r*)r.rrr�test_not_present_exceptionbsr?)!Znumpy�nprZpandasrrrrZpandas._testingZ_testingrZpandas.utilr�td�nanrr0�encoderZfixturerr!r/r1Z
skip_if_nor6r:�markZparametrizer<r>Zskip_if_installedr?rrrr�<module>s*