zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
U
­ý°dXã    @sddlZddlmZddlZddlmZddlZddlZddl    m
Z
m Z m Z m Z mZmZmZddlmZddlmZmZejjZdd„Zd    d
„Zd d „Zd d„Zdd„Zdd„Zej  deddddde
e!dƒƒg¡dd„ƒZ"dd„Z#dd„Z$d d!„Z%ej  d"d#d$gd%d&g¡d'd(„ƒZ&dS))éN)ÚBytesIO)Úcatch_warnings)ÚCategoricalIndexÚ    DataFrameÚHDFStoreÚ
MultiIndexÚ_testingÚ
date_rangeÚread_hdf)Úensure_clean_store)ÚTermÚ_maybe_adjust_namec
Csˆt ¡}t|ƒn}| d|¡d}tjt|d|jddgdW5QRXd}tjt|d|jddgdW5QRXW5QRXdS)    NÚdfzqcannot pass a column specification when reading a Fixed format store. this store must be selected in its entirety©ÚmatchÚA)Úcolumnszucannot pass a where specification when reading from a Fixed format store. this store must be selected in its entiretyz    columns=A©Úwhere)ÚtmÚ makeDataFramer ÚputÚpytestÚraisesÚ    TypeErrorÚselect)Ú
setup_pathrÚstoreÚmsg©rú[d:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/tests/io/pytables/test_errors.pyÚtest_pass_spec_to_storers
 ÿÿr!c
CsŽtddddgiƒ}tddddgitddd    d
}t|ƒL}|jd |d d t d¡}tjt|d|jd |d ddW5QRXW5QRXdS)NÚaééééééz1/1/2000©Úperiods)ÚindexÚframeÚtable©Úformatz/incompatible kind in col [integer - datetime64]rT)r/Úappend)    rr    r rÚreÚescaperrr)rZdf1Údf2rrrrr Ú$test_table_index_incompatible_dtypes/s
 
r4c Csþt|ƒv}dt ddd¡fg}|D]V\}}t ¡}|||<t d|›d¡}tjt    |d| 
d|›|¡W5QRXq"W5QRXt ¡}d    |d
<d |d <t ddd¡|d <|  ¡}t|ƒ6}t d¡}tjt    |d| 
d|¡W5QRXW5QRXdS)NÚdateiÑr#r$ú[z&] is not implemented as a table columnrZdf1_ÚfooZobj1ÚbarÚobj2Z    datetime1zjCannot serialize the column [datetime1]
because its data contents are not [string] but [date] object dtypeZdf_unimplemented) r Údatetimer5rrr1r2rrrr0Z _consolidate)rrZdtypesÚnÚfrrrrr Ú'test_unimplemented_dtypes_table_columns:s&
 (
ÿr=c Cs¬t|ƒØ}tddÂt ¡}d|d<d|j|jdd…df<|jd|d    d
t d ¡}t    j
t |d  t ƒW5QRXt d ¡}t    j
t |d | dd¡W5QRXd}t    j
t|d | dd¡W5QRXW5QRXW5QRX||}ttj dd¡tdƒtdddd}|j|dd    ddt|dddt|ddd||}ttj dd¡tdƒtdddd}|j|dd    d
d}t    j
t |d t|dddW5QRXdS)NT)Úrecordr7Ústringr8rr&rr-r.z:__init__() missing 1 required positional argument: 'where'rzWcannot process expression [df.index[3]], [2000-01-06 00:00:00] is not a valid conditionz df.index[3]zinvalid syntaxzindex>é
ÚABCDZ20130101r))rr+Údfq)r/Z data_columnsz0index>Timestamp('20130104') & columns=['A', 'B']rz
A>0 or C>0aThe passed where expression: A>0 or C>0\n\s*contains an invalid variable reference\n\s*all of the variable references must be a reference to\n\s*an axis \(e.g. 'index' or 'columns'\), or a data_column\n\s*The currently defined references are: index,columns\n)r rrZmakeTimeDataFrameÚlocr+rr1r2rrrr Ú
ValueErrorrÚ SyntaxErrorrÚnpÚrandomÚrandnÚlistr    Úto_hdfr
)Útmp_pathrrrrÚpathrBrrr Útest_invalid_termsWsN
 ÿÿ* 
ý 
ýÿrMc
CsÞttj dd¡ƒ}tdtj d¡iƒ}tdtj d¡iƒ}tdtj d¡iƒ}tddtftj d¡iƒ}t|ƒd}dt d¡›}| ||¡||||fD]4}t     
d    ¡}    t j t |    d
| ||¡W5QRXqšW5QRXdS) Nr@r#r"©r#r$)Ú1r$rOr$Zdf_z?cannot match existing table structure for [0] on appending datar)rrFrGrHÚobjectr rZrandsr0r1r2rrrD)
rrr3Zdf3Zdf4Zdf5rÚnameÚdrrrr Ú7test_append_with_diff_col_name_types_raises_value_error”s
 ÿrSc
Cshttj dd¡tdƒtdƒd}t |¡4}d}tjt    |d|j
|dd    d
W5QRXW5QRXdS) Nr&r'ÚabcdÚABCDE©r+rz)complib only supports \[.*\] compression.rrZfoolib)Zcomplib) rrFrGÚrandrIrZ ensure_cleanrrrDrJ)rrrLrrrr Útest_invalid_complib§s
  rXÚidxZ2019ÚDr%ÚUTC)Úfreqr*ÚtzÚabcc    CsPt ||g¡}td|dgd}||}tjtdd| |d¡W5QRXdS)Nrr"rVzSaving a MultiIndexrr)rZ from_arraysrrrÚNotImplementedErrorrJ)rYrKrÚmirrLrrr Ú&test_to_hdf_multiindex_extension_dtype¯s
    rac    Cs6|dddƒ}d}tjt|dt|ƒW5QRXdS)NÚioÚdataz"legacy_hdf/incompatible_dataset.h5z_Dataset\(s\) incompatible with Pandas data types, not table, or no datasets found in HDF5 file.r)rrrDr
)ÚdatapathZ    data_pathÚmessagerrr Útest_unsuppored_hdf_file_error¿s
 ÿrfc    Csœttj dd¡tdƒtdƒd}||}d}tjt|dt|dƒW5QRX|     |d    ¡t
|d
d }|  ¡d }tjt|dt|d    ƒW5QRXdS) Nr&r'rTrUrVzFile [\S]* does not existrÚkeyrÚr)Úmodez&The HDFStore must be open for reading.) rrFrGrWrIrrÚOSErrorr
rJrÚclose)rrKrrLrrrrr Útest_read_hdf_errorsËs   rlc    Cs0d}tjt|dttdƒdƒW5QRXdS)Nz5Support for generic buffers has not been implemented.rór)rrr_r
r)rrrr Ú#test_read_hdf_generic_buffer_errorsÜsrnÚ bad_versionrN)r#Z12Z123c    Cs.d}tjt|dtd|dW5QRXdS)Nz5Version is incorrect, expected sequence of 3 integersrZvalues_block_0)Úversion)rrrDr )rorrrr Ú)test_maybe_adjust_name_bad_version_raisesâsrq)'r:rbrr1ÚwarningsrÚnumpyrFrZpandasrrrrrrr    r
Zpandas.tests.io.pytables.commonr Zpandas.io.pytablesr r ÚmarkZ
single_cpuZ
pytestmarkr!r4r=rMrSrXZ parametrizerIrarfrlrnrqrrrr Ú<module>s6  $      =
þþ